mirror of https://github.com/sipwise/kamailio.git
Free shm memory taken before and inside pvh_merge_uri() in case of error. Change-Id: I219436e5a8adabc27326faa2c3ba8aa26d3fe003 (cherry picked from commitmr14.1.1ec926092f2) (cherry picked from commit3de26013ea)
parent
2eba04b684
commit
31fef3f2ee
@ -0,0 +1,31 @@
|
||||
--- a/src/modules/pv_headers/pvh_xavp.c
|
||||
+++ b/src/modules/pv_headers/pvh_xavp.c
|
||||
@@ -713,7 +713,13 @@ xavp_c_data_t *pvh_set_parsed(
|
||||
return c_data;
|
||||
|
||||
err:
|
||||
- // how can I call?? pvh_xavi_free_data(c_data, shm_free);
|
||||
+ if(c_data != NULL) {
|
||||
+ if(c_data->value.s != NULL) {
|
||||
+ shm_free(c_data->value.s);
|
||||
+ }
|
||||
+ shm_free(c_data);
|
||||
+ c_data = NULL;
|
||||
+ }
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -886,6 +892,13 @@ int pvh_set_uri(struct sip_msg *msg, pv_
|
||||
err:
|
||||
if(pv_format)
|
||||
pv_elem_free_all(pv_format);
|
||||
+ if(c_data != NULL) {
|
||||
+ if(c_data->value.s != NULL) {
|
||||
+ shm_free(c_data->value.s);
|
||||
+ }
|
||||
+ shm_free(c_data);
|
||||
+ c_data = NULL;
|
||||
+ }
|
||||
return -1;
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue