[sr-dev] git:4.2:8f324fb6: pua: mark that tupple was allocated so can be freed in case of errors

Daniel-Constantin Mierla miconda at gmail.com
Tue May 19 09:32:25 CEST 2015


Module: kamailio
Branch: 4.2
Commit: 8f324fb6b3955ea6d5d4e57ec022d400f2c4e124
URL: https://github.com/kamailio/kamailio/commit/8f324fb6b3955ea6d5d4e57ec022d400f2c4e124

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-05-19T09:29:35+02:00

pua: mark that tupple was allocated so can be freed in case of errors

(cherry picked from commit 1b20aa04048d15d0861b3f5291fd3b9a1614fdf5)

---

Modified: modules/pua/add_events.c

---

Diff:  https://github.com/kamailio/kamailio/commit/8f324fb6b3955ea6d5d4e57ec022d400f2c4e124.diff
Patch: https://github.com/kamailio/kamailio/commit/8f324fb6b3955ea6d5d4e57ec022d400f2c4e124.patch

---

diff --git a/modules/pua/add_events.c b/modules/pua/add_events.c
index f8ef09c..d48ea5f 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;
 		}
 	}
 




More information about the sr-dev mailing list