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

4
cli.c
View File

@@ -864,12 +864,14 @@ int ast_cli_generatornummatches(char *text, char *word)
while ( (buf = ast_cli_generator(text, word, i)) ) {
if (++i > 1 && strcmp(buf,oldbuf) == 0) {
free(buf);
continue;
}
oldbuf = buf;
matches++;
}
free(oldbuf);
free(buf);
return matches;
}