Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/speex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-06-23 07:57:58 +0400
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-06-23 07:57:58 +0400
commit176908c4e3e86eb171a68ca20e99594642be9939 (patch)
tree69af445efc883ffbd17d5856e1ed61e08c7c7c67
parentb784232ba9637956c1300fbca3284af2f5de5b75 (diff)
check for malloc failure
git-svn-id: http://svn.xiph.org/branches/speex-branches/speex-1.0-branch@13174 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r--src/speexenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/speexenc.c b/src/speexenc.c
index 5cfa002..d36700a 100644
--- a/src/speexenc.c
+++ b/src/speexenc.c
@@ -803,6 +803,8 @@ void comment_init(char **comments, int* length, char *vendor_string)
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);
@@ -821,6 +823,8 @@ void comment_add(char **comments, int* length, char *tag, char *val)
p=(char*)realloc(p, len);
if(p==NULL){
+ fprintf (stderr, "realloc failed in comment_add()\n");
+ exit(1);
}
writeint(p, *length, tag_len+val_len); /* length of comment */