Module: kamailio
Branch: master
Commit: 1b20aa04048d15d0861b3f5291fd3b9a1614fdf5
URL:
https://github.com/kamailio/kamailio/commit/1b20aa04048d15d0861b3f5291fd3b9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-05-14T13:09:47+02:00
pua: mark that tupple was allocated so can be freed in case of errors
---
Modified: modules/pua/add_events.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1b20aa04048d15d0861b3f5291fd3b9…
Patch:
https://github.com/kamailio/kamailio/commit/1b20aa04048d15d0861b3f5291fd3b9…
---
diff --git a/modules/pua/add_events.c b/modules/pua/add_events.c
index 5446745..f4a9c8e 100644
--- a/modules/pua/add_events.c
+++ b/modules/pua/add_events.c
@@ -194,6 +194,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)
{
@@ -203,7 +204,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;
}
}