git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-11-10 23:34:30 +00:00
parent 8fddeef1ac
commit 8c9a32bd4b
2 changed files with 6 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
2005-11-10 Kevin P. Fleming <kpfleming@digium.com>
* channels/chan_iax2.c (complete_iax2_show_peer): don't return from function without releasing lock (issue #5685)
* channels/iax2-provision.c (iax_provision_reload): don't leak memory (issue #5700)
* pbx/pbx_ael.c (handle_macro): don't leak memory (issue #5701)

View File

@@ -1970,6 +1970,7 @@ static char *complete_iax2_show_peer(char *line, char *word, int pos, int state)
{
int which = 0;
struct iax2_peer *p;
char *res = NULL;
/* 0 - iax2; 1 - show; 2 - peer; 3 - <peername> */
if(pos == 3) {
@@ -1977,14 +1978,15 @@ static char *complete_iax2_show_peer(char *line, char *word, int pos, int state)
for(p = peerl.peers ; p ; p = p->next) {
if(!strncasecmp(p->name, word, strlen(word))) {
if(++which > state) {
return strdup(p->name);
res = strdup(p->name);
break;
}
}
}
ast_mutex_unlock(&peerl.lock);
}
return NULL;
return res;
}
static int iax2_show_stats(int fd, int argc, char *argv[])