From: Russell Bryant Date: Fri, 19 Jan 2007 16:44:09 +0000 (+0000) Subject: Fix a memory leak on command line tab completion. The container for the X-Git-Tag: 1.2.15~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a73ba87b19cc1901170b70e0afb2c8dba75111b;p=thirdparty%2Fasterisk.git 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) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@51300 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/asterisk.c b/asterisk.c index bc15eb5c7d..d3b3989dea 100644 --- a/asterisk.c +++ b/asterisk.c @@ -1656,7 +1656,9 @@ static char *cli_complete(EditLine *el, int ch) retval = CC_REFRESH; } } - free(matches); + for (i=0; matches[i]; i++) + free(matches[i]); + free(matches); } return (char *)(long)retval;