Merged revisions 51302 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Fri, 19 Jan 2007 17:02:36 +0000 (17:02 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 19 Jan 2007 17:02:36 +0000 (17:02 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r51302 | russell | 2007-01-19 10:56:17 -0600 (Fri, 19 Jan 2007) | 12 lines

Merged revisions 51300 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51300 | russell | 2007-01-19 10:44:09 -0600 (Fri, 19 Jan 2007) | 4 lines

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/trunk@51303 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c

index cc147f1..4d5d5d4 100644 (file)
@@ -1968,6 +1968,8 @@ static char *cli_complete(EditLine *el, int ch)
                                retval = CC_REFRESH;
                        }
                }
+               for (i = 0; matches[i]; i++)
+                       free(matches[i]);
                free(matches);
        }