From 8f324fb6b3955ea6d5d4e57ec022d400f2c4e124 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Thu, 14 May 2015 13:09:47 +0200 Subject: [PATCH] pua: mark that tupple was allocated so can be freed in case of errors (cherry picked from commit 1b20aa04048d15d0861b3f5291fd3b9a1614fdf5) --- modules/pua/add_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/pua/add_events.c b/modules/pua/add_events.c index f8ef09cee82..d48ea5f3872 100644 --- a/modules/pua/add_events.c +++ b/modules/pua/add_events.c @@ -197,6 +197,7 @@ int pres_process_body(publ_info_t* publ, str** fin_body, int ver, str** tuple_pa LM_ERR("No more memory\n"); goto error; } + alloc_tuple= 1; tuple->s= (char*)pkg_malloc(tuple_id_len* sizeof(char)); if(tuple->s== NULL) { @@ -206,7 +207,6 @@ int pres_process_body(publ_info_t* publ, str** fin_body, int ver, str** tuple_pa memcpy(tuple->s, tuple_id, tuple_id_len); tuple->len= tuple_id_len; *tuple_param= tuple; - alloc_tuple= 1; } }