Back out "leak" fixes, as it causes segfaults
authorMark Spencer <markster@digium.com>
Sun, 9 Nov 2003 20:31:54 +0000 (20:31 +0000)
committerMark Spencer <markster@digium.com>
Sun, 9 Nov 2003 20:31:54 +0000 (20:31 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1713 65c4cc65-6c06-0410-ace0-fbb531ad65f3

asterisk.c
cli.c

index 29c1645..8e64773 100755 (executable)
@@ -949,7 +949,6 @@ 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') {
@@ -979,10 +978,6 @@ 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);
        }
 
diff --git a/cli.c b/cli.c
index 544ead8..ae6876f 100755 (executable)
--- a/cli.c
+++ b/cli.c
@@ -864,14 +864,12 @@ 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;
 }