[asterisk-commits] branch 1.2 r32582 - /branches/1.2/callerid.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jun 6 09:02:44 MST 2006


Author: tilghman
Date: Tue Jun  6 11:02:43 2006
New Revision: 32582

URL: http://svn.digium.com/view/asterisk?rev=32582&view=rev
Log:
Bug 7268 - Callerid leaks memory on error

Modified:
    branches/1.2/callerid.c

Modified: branches/1.2/callerid.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/callerid.c?rev=32582&r1=32581&r2=32582&view=diff
==============================================================================
--- branches/1.2/callerid.c (original)
+++ branches/1.2/callerid.c Tue Jun  6 11:02:43 2006
@@ -274,6 +274,7 @@
 		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 @@
 			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 @@
 					strcpy(cid->name, "");
 					cid->flags |= CID_UNKNOWN_NAME;
 				}
+				free(obuf);
 				return 1;
 				break;
 			default:



More information about the asterisk-commits mailing list