diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-21 04:08:54 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-21 04:08:54 +0000 |
commit | 0422554bb09e284f6f271eb9a47c522c4ec176aa (patch) | |
tree | 24ff168c12801bb42f7fd7bf49b151cb37e34019 /apps/app_zapscan.c | |
parent | 47561cd6e07cf3abe7820cab6fef6f6f89f6d9e3 (diff) |
Fix locking in zapscan
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3251 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_zapscan.c')
-rwxr-xr-x | apps/app_zapscan.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/apps/app_zapscan.c b/apps/app_zapscan.c index f449c7f36..dab62711d 100755 --- a/apps/app_zapscan.c +++ b/apps/app_zapscan.c @@ -72,10 +72,7 @@ static struct ast_channel *get_zap_channel_locked(int num) { ast_mutex_unlock(&c->lock); c = ast_channel_walk_locked(c); } - if (c) - return c; - - return NULL; + return c; } static int careful_write(int fd, unsigned char *data, int len) @@ -334,7 +331,8 @@ static int conf_exec(struct ast_channel *chan, void *data) res = conf_run(chan, confno, confflags); if (res<0) break; input = res; - } + } else if (tempchan) + ast_mutex_unlock(&tempchan->lock); lastchan = tempchan; } LOCAL_USER_REMOVE(u); |