[svn-commits] russell: branch 1.4 r46883 - in /branches/1.4: ./ main/callerid.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Nov 2 07:02:38 MST 2006


Author: russell
Date: Thu Nov  2 08:02:37 2006
New Revision: 46883

URL: http://svn.digium.com/view/asterisk?rev=46883&view=rev
Log:
Add the missing call to free described in issue #8268.  Also, add a bunch of
missing calls to free in callerid_feed_jp().

Modified:
    branches/1.4/   (props changed)
    branches/1.4/main/callerid.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/main/callerid.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/callerid.c?rev=46883&r1=46882&r2=46883&view=diff
==============================================================================
--- branches/1.4/main/callerid.c (original)
+++ branches/1.4/main/callerid.c Thu Nov  2 08:02:37 2006
@@ -300,12 +300,13 @@
 		buf[x+cid->oldlen/2] = AST_XLAW(ubuf[x]);
 
 	while (mylen >= 160) {
-	b = b2 = 0 ;
+		b = b2 = 0;
 		olen = mylen;
 		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;
 		}
 
@@ -313,6 +314,7 @@
 
 		if (res < 0) {
 			ast_log(LOG_NOTICE, "fsk_serie failed\n");
+			free(obuf);
 			return -1;
 		}
 
@@ -384,6 +386,7 @@
 					cid->len = b;
 					if ( (cid->len+2) >= sizeof( cid->rawdata ) ) {
 						ast_log(LOG_WARNING, "too long caller id string\n" ) ;
+						free(obuf);
 						return -1;
 					}
 					cid->rawdata[cid->pos++] = b;
@@ -406,6 +409,7 @@
 					cid->sawflag = 12;
 					if ( cid->crc != 0 ) {
 						ast_log(LOG_WARNING, "crc checksum error\n" ) ;
+						free(obuf);
 						return -1;
 					} 
 					/* extract caller id data */
@@ -515,6 +519,7 @@
 							break ;
 						}
 					}
+					free(obuf);
 					return 1;
 					break;
 				default:
@@ -563,6 +568,7 @@
 		buf += (olen - mylen);
 		if (res < 0) {
 			ast_log(LOG_NOTICE, "fsk_serie failed\n");
+			free(obuf);
 			return -1;
 		}
 		if (res == 1) {



More information about the svn-commits mailing list