Module: kamailio
Branch: master
Commit: 4991821daf9053cdd68957b18bfa23b8e906a00e
URL:
https://github.com/kamailio/kamailio/commit/4991821daf9053cdd68957b18bfa23b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-12-01T12:37:06+01:00
ss7ops: safety check before freeing allocated isup json buffer
---
Modified: modules/ss7ops/ss7ops_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4991821daf9053cdd68957b18bfa23b…
Patch:
https://github.com/kamailio/kamailio/commit/4991821daf9053cdd68957b18bfa23b…
---
diff --git a/modules/ss7ops/ss7ops_mod.c b/modules/ss7ops/ss7ops_mod.c
index 26aaeb6..efeb816 100644
--- a/modules/ss7ops/ss7ops_mod.c
+++ b/modules/ss7ops/ss7ops_mod.c
@@ -61,7 +61,7 @@ struct mtp_level_3_hdr {
* ss7 module - helper module to convert M2UA/ISUP to JSON
*
*/
-static const char *isup_last;
+static const char *isup_last = NULL;
static int w_isup_to_json(struct sip_msg* _m, char* param1, char* param2);
static int pv_get_isup(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
@@ -259,7 +259,7 @@ static int w_isup_to_json(struct sip_msg *_m, char *param1, char
*param2)
int opc, dpc, mtp_type, int_len, rc;
size_t len;
- free((char *) isup_last);
+ if(isup_last) free((char *) isup_last);
isup_last = NULL;
data = fetch_payload(_m, "$var(payload)", &int_len);