From: Tilghman Lesher Date: Tue, 6 Jun 2006 16:02:43 +0000 (+0000) Subject: Bug 7268 - Callerid leaks memory on error X-Git-Tag: 1.2.9.1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43fa2d54ef37dfbfaceb856c191df72103d525cf;p=thirdparty%2Fasterisk.git Bug 7268 - Callerid leaks memory on error git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@32582 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/callerid.c b/callerid.c index a0937b24af..f709bd5017 100644 --- a/callerid.c +++ b/callerid.c @@ -274,6 +274,7 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int res = fsk_serie(&cid->fskd, buf, &mylen, &b); if (mylen < 0) { ast_log(LOG_ERROR, "fsk_serie made mylen < 0 (%d)\n", mylen); + free(obuf); return -1; } buf += (olen - mylen); @@ -307,6 +308,7 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int case 4: /* Retrieve message */ if (cid->pos >= 128) { ast_log(LOG_WARNING, "Caller ID too long???\n"); + free(obuf); return -1; } cid->rawdata[cid->pos++] = b; @@ -392,6 +394,7 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int strcpy(cid->name, ""); cid->flags |= CID_UNKNOWN_NAME; } + free(obuf); return 1; break; default: