mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
Back out "leak" fixes, as it causes segfaults
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -949,7 +949,6 @@ static char *cli_complete(EditLine *el, int ch)
|
|||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
int i;
|
int i;
|
||||||
int x;
|
|
||||||
int matches_num, maxlen, match_len;
|
int matches_num, maxlen, match_len;
|
||||||
|
|
||||||
if (matches[0][0] != '\0') {
|
if (matches[0][0] != '\0') {
|
||||||
@@ -979,10 +978,6 @@ static char *cli_complete(EditLine *el, int ch)
|
|||||||
retval = CC_REFRESH;
|
retval = CC_REFRESH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (x=0; matches[x]; x++) {
|
|
||||||
free(matches[x]);
|
|
||||||
matches[x] = NULL;
|
|
||||||
}
|
|
||||||
free(matches);
|
free(matches);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
cli.c
4
cli.c
@@ -864,14 +864,12 @@ int ast_cli_generatornummatches(char *text, char *word)
|
|||||||
|
|
||||||
while ( (buf = ast_cli_generator(text, word, i)) ) {
|
while ( (buf = ast_cli_generator(text, word, i)) ) {
|
||||||
if (++i > 1 && strcmp(buf,oldbuf) == 0) {
|
if (++i > 1 && strcmp(buf,oldbuf) == 0) {
|
||||||
free(buf);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
oldbuf = buf;
|
oldbuf = buf;
|
||||||
matches++;
|
matches++;
|
||||||
}
|
}
|
||||||
free(oldbuf);
|
|
||||||
free(buf);
|
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user