summaryrefslogtreecommitdiff
path: root/cli.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2003-04-29 05:32:37 +0000
committerMark Spencer <markster@digium.com>2003-04-29 05:32:37 +0000
commite4c20dbe87091d6cac21fa25c0a7bd96cb35616a (patch)
treeb6a76e637848825305205e08af0e5f1f85f3640e /cli.c
parentc58934fd46dbde2246cfb55badcc336fd96bd459 (diff)
Minor CLI fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cli.c')
-rwxr-xr-xcli.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/cli.c b/cli.c
index 04aa02cdb..fa33bcc33 100755
--- a/cli.c
+++ b/cli.c
@@ -775,11 +775,8 @@ 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;
}
- if (oldbuf)
- free(oldbuf);
oldbuf = buf;
matches++;
}
@@ -876,7 +873,7 @@ static char *__ast_cli_generator(char *text, char *word, int state, int lock)
if (lock)
ast_pthread_mutex_unlock(&clilock);
free(dup);
- return res ? strdup(res) : NULL;
+ return res ? res : NULL;
}
}
}