Skip to content

Commit

Permalink
Fixed crash if send_subscribe fails early
Browse files Browse the repository at this point in the history
In that case presentity is still NULL, check for it
  • Loading branch information
saghul committed Aug 7, 2013
1 parent 1ee176a commit 6e3b16e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/pua/send_subscribe.c
Expand Up @@ -564,8 +564,13 @@ void subs_cback_func(struct cell *t, int cb_type, struct tmcb_params *ps)
error:
if(hentity)
{
if(presentity->extra_headers.s) shm_free(presentity->extra_headers.s);
if(presentity->remote_contact.s) shm_free(presentity->remote_contact.s);
if(presentity)
{
if(presentity->extra_headers.s)
shm_free(presentity->extra_headers.s);
if(presentity->remote_contact.s)
shm_free(presentity->remote_contact.s);
}
shm_free(hentity);
hentity= NULL;
}
Expand Down

0 comments on commit 6e3b16e

Please sign in to comment.