[xiph-commits] r13177 - trunk/speex/src

jm at svn.xiph.org jm at svn.xiph.org
Fri Jun 22 21:24:48 PDT 2007


Author: jm
Date: 2007-06-22 21:24:48 -0700 (Fri, 22 Jun 2007)
New Revision: 13177

Modified:
   trunk/speex/src/speexenc.c
Log:
check for malloc failure


Modified: trunk/speex/src/speexenc.c
===================================================================
--- trunk/speex/src/speexenc.c	2007-06-23 04:15:31 UTC (rev 13176)
+++ trunk/speex/src/speexenc.c	2007-06-23 04:24:48 UTC (rev 13177)
@@ -949,6 +949,8 @@
   int len=4+vendor_length+4;
   char *p=(char*)malloc(len);
   if(p==NULL){
+     fprintf (stderr, "malloc failed in comment_init()\n");
+     exit(1);
   }
   writeint(p, 0, vendor_length);
   memcpy(p+4, vendor_string, vendor_length);
@@ -967,6 +969,8 @@
 
   p=(char*)realloc(p, len);
   if(p==NULL){
+     fprintf (stderr, "malloc failed in comment_init()\n");
+     exit(1);
   }
 
   writeint(p, *length, tag_len+val_len);      /* length of comment */



More information about the commits mailing list