[asterisk-commits] russell: branch 1.2 r51300 - /branches/1.2/asterisk.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 19 09:44:10 MST 2007


Author: russell
Date: Fri Jan 19 10:44:09 2007
New Revision: 51300

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51300
Log:
Fix a memory leak on command line tab completion.  The container for the
matches was freed, but the individual matches themselves were not.
(issue #8851, arkadia)

Modified:
    branches/1.2/asterisk.c

Modified: branches/1.2/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/asterisk.c?view=diff&rev=51300&r1=51299&r2=51300
==============================================================================
--- branches/1.2/asterisk.c (original)
+++ branches/1.2/asterisk.c Fri Jan 19 10:44:09 2007
@@ -1656,7 +1656,9 @@
 				retval = CC_REFRESH;
 			}
 		}
-	free(matches);
+		for (i=0; matches[i]; i++)
+			free(matches[i]);
+		free(matches);
 	}
 
 	return (char *)(long)retval;



More information about the asterisk-commits mailing list