[asterisk-commits] file: trunk r197538 - /trunk/main/utils.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 28 09:51:47 CDT 2009


Author: file
Date: Thu May 28 09:51:43 2009
New Revision: 197538

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=197538
Log:
Fix a bug in stringfields where it did not actually free the pools of memory.

(closes issue #15074)
Reported by: pj

Modified:
    trunk/main/utils.c

Modified: trunk/main/utils.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/utils.c?view=diff&rev=197538&r1=197537&r2=197538
==============================================================================
--- trunk/main/utils.c (original)
+++ trunk/main/utils.c Thu May 28 09:51:43 2009
@@ -1560,7 +1560,11 @@
 	}
 
 	if (needed < 0) {		/* reset all pools */
-		/* nothing to do */
+		if (*pool_head == NULL) {
+			ast_log(LOG_WARNING, "trying to reset empty pool\n");
+			return -1;
+		}
+		cur = *pool_head;
 	} else if (mgr->embedded_pool) { /* preserve the embedded pool */
 		preserve = mgr->embedded_pool;
 		cur = *pool_head;




More information about the asterisk-commits mailing list