diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-09 20:08:41 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-09 20:08:41 +0000 |
commit | b165c5aad85e432d04364423dbc33f45f65ed7c3 (patch) | |
tree | d7c788a30d8ac5ec1c8a7ab2ef18e6d52c9efb30 /channels/chan_sip.c | |
parent | 94e2ddbc04c27c4b126acc25e1e84ccbf947fb5d (diff) |
Fix SIP buglets
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3965 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rwxr-xr-x | channels/chan_sip.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f0f5c0281..0994b04ba 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1098,7 +1098,7 @@ static struct sip_peer *realtime_peer(const char *peername, struct sockaddr_in * } ast_destroy_realtime(var); } - return NULL; + return peer; } /*--- find_peer: Locate peer by name or ip address */ @@ -5341,12 +5341,15 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, char *cmd if (user && debug) ast_verbose("Found user '%s'\n", user->name); } else { - if (user && debug) - ast_verbose("Found user '%s', but fails host access\n", user->name); + if (user) { + if (debug) + ast_verbose("Found user '%s', but fails host access\n", user->name); + if (user->temponly) + destroy_user(user); + } user = NULL; } - if (user && user->temponly) - destroy_user(user); + /* Temp user gets cleaned up at the end */ ast_mutex_unlock(&userl.lock); if (!user) { /* If we didn't find a user match, check for peers */ @@ -5429,9 +5432,8 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, char *cmd } - if (user && user->temponly) { + if (user && user->temponly) destroy_user(user); - } return res; } |