diff options
Diffstat (limited to 'asterisk.c')
-rw-r--r-- | asterisk.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/asterisk.c b/asterisk.c index 642f1b5d8..ad9cfb831 100644 --- a/asterisk.c +++ b/asterisk.c @@ -548,11 +548,9 @@ static char *complete_show_version_files(const char *line, const char *word, int AST_LIST_LOCK(&file_versions); AST_LIST_TRAVERSE(&file_versions, find, list) { - if (!strncasecmp(word, find->file, matchlen)) { - if (++which > state) { - ret = strdup(find->file); - break; - } + if (!strncasecmp(word, find->file, matchlen) && ++which > state) { + ret = ast_strdup(find->file); + break; } } AST_LIST_UNLOCK(&file_versions); |