aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-06 16:05:29 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-06 16:05:29 +0000
commit77abfdfd00db4460aeb6e9c3b5065406486ca4f4 (patch)
tree6840b3935458231822bb3d6968c612271671d9f0
parent5b2d437368e4ad55c0eceb2ff7dbf350a427d355 (diff)
Merged revisions 32582 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r32582 | tilghman | 2006-06-06 11:02:43 -0500 (Tue, 06 Jun 2006) | 2 lines Bug 7268 - Callerid leaks memory on error ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32596 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--callerid.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/callerid.c b/callerid.c
index 195ae1f8f..1b52447b5 100644
--- a/callerid.c
+++ b/callerid.c
@@ -557,6 +557,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);
@@ -590,6 +591,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;
@@ -675,6 +677,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: