CLI memory leak patch

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-11-09 19:33:39 +00:00
parent f4cafc5041
commit 9f110a3b81
2 changed files with 8 additions and 1 deletions

View File

@@ -949,6 +949,7 @@ static char *cli_complete(EditLine *el, int ch)
if (matches) {
int i;
int x;
int matches_num, maxlen, match_len;
if (matches[0][0] != '\0') {
@@ -978,6 +979,10 @@ static char *cli_complete(EditLine *el, int ch)
retval = CC_REFRESH;
}
}
for (x=0; matches[x]; x++) {
free(matches[x]);
matches[x] = NULL;
}
free(matches);
}