Don't seg when out of memory (bug #2120)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@129 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
parent
6dd859f5de
commit
748702c5c5
2
q921.c
2
q921.c
@ -383,8 +383,8 @@ int q921_transmit_iframe(struct pri *pri, void *buf, int len, int cr)
|
|||||||
q921_frame *f, *prev=NULL;
|
q921_frame *f, *prev=NULL;
|
||||||
for (f=pri->txqueue; f; f = f->next) prev = f;
|
for (f=pri->txqueue; f; f = f->next) prev = f;
|
||||||
f = malloc(sizeof(q921_frame) + len + 2);
|
f = malloc(sizeof(q921_frame) + len + 2);
|
||||||
memset(f,0,sizeof(q921_frame) + len + 2);
|
|
||||||
if (f) {
|
if (f) {
|
||||||
|
memset(f,0,sizeof(q921_frame) + len + 2);
|
||||||
Q921_INIT(pri, f->h);
|
Q921_INIT(pri, f->h);
|
||||||
switch(pri->localtype) {
|
switch(pri->localtype) {
|
||||||
case PRI_NETWORK:
|
case PRI_NETWORK:
|
||||||
|
Loading…
Reference in New Issue
Block a user