diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-08 13:45:36 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-08 13:45:36 +0000 |
commit | 2ac8552c3a7ca0e4af0ce80e722a515e9031d641 (patch) | |
tree | c486ebb15ee9d101ffc846c11bb6405b7c829e86 /asterisk.c | |
parent | 34567e719d310a0e3948686703359218e08885f9 (diff) |
Fix some leaks in CLI (thanks James)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@777 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-x | asterisk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/asterisk.c b/asterisk.c index 8b4ae4504..b0635c7f2 100755 --- a/asterisk.c +++ b/asterisk.c @@ -686,14 +686,14 @@ static int ast_el_read_char(EditLine *el, char *cp) static char *cli_prompt(EditLine *el) { - char prompt[80]; + static char prompt[80]; if (remotehostname) snprintf(prompt, sizeof(prompt), ASTERISK_PROMPT2, remotehostname); else snprintf(prompt, sizeof(prompt), ASTERISK_PROMPT); - return strdup(prompt); + return(prompt); } static char **ast_el_strtoarr(char *buf) @@ -839,7 +839,7 @@ static char *cli_complete(EditLine *el, int ch) if (nummatches == 1) { /* Found an exact match */ - el_insertstr(el, strdup(" ")); + el_insertstr(el, " "); retval = CC_REFRESH; } else { /* Must be more than one match */ @@ -854,11 +854,11 @@ static char *cli_complete(EditLine *el, int ch) ast_cli_display_match_list(matches, nummatches, maxlen); retval = CC_REDISPLAY; } else { - el_insertstr(el,strdup(" ")); + el_insertstr(el," "); retval = CC_REFRESH; } } - + free(matches); } return (char *)retval; |