From 748702c5c569fcc7db009867051269abbc386caf Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Fri, 23 Jul 2004 16:04:01 +0000 Subject: [PATCH] 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 --- q921.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/q921.c b/q921.c index 4c046ac..1a64b3d 100755 --- a/q921.c +++ b/q921.c @@ -383,8 +383,8 @@ int q921_transmit_iframe(struct pri *pri, void *buf, int len, int cr) q921_frame *f, *prev=NULL; for (f=pri->txqueue; f; f = f->next) prev = f; f = malloc(sizeof(q921_frame) + len + 2); - memset(f,0,sizeof(q921_frame) + len + 2); if (f) { + memset(f,0,sizeof(q921_frame) + len + 2); Q921_INIT(pri, f->h); switch(pri->localtype) { case PRI_NETWORK: