Skip to content

Commit

Permalink
presence: fix memory leak introduced by last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Lavin committed Jul 25, 2016
1 parent 122e9b4 commit 3c09579
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/presence/presentity.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body,
goto error;
}

free(dialog_id);

LM_DBG("inserting %d cols into table\n",n_query_cols);

if (pa_dbf.insert(pa_db, query_cols, query_vals, n_query_cols) < 0)
Expand Down Expand Up @@ -650,9 +652,10 @@ int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body,
goto error;
}

free(dialog_id);

if(is_dialog== 1) /* if the new body has a dialog - overwrite */
{
free(dialog_id);
goto after_dialog_check;
}

Expand Down

0 comments on commit 3c09579

Please sign in to comment.