Module: kamailio
Branch: 5.1
Commit: 1bf7918a01bd0e7528a7706421935d10bd11198d
URL:
https://github.com/kamailio/kamailio/commit/1bf7918a01bd0e7528a7706421935d1…
Author: Seudin Kasumovic <seudin.kasumovic(a)gmail.com>
Committer: Seudin Kasumovic <seudin.kasumovic(a)gmail.com>
Date: 2018-01-04T09:23:39+01:00
erlang: fix bad free
Avoid to free non-pointer, likely causing a crash later.
(cherry picked from commit 3680a1a6ec6971e79deb76daafc89cf2fe206c60)
---
Modified: src/modules/erlang/erlang_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1bf7918a01bd0e7528a7706421935d1…
Patch:
https://github.com/kamailio/kamailio/commit/1bf7918a01bd0e7528a7706421935d1…
---
diff --git a/src/modules/erlang/erlang_mod.c b/src/modules/erlang/erlang_mod.c
index 1c3c12efeb..54d2fa1733 100644
--- a/src/modules/erlang/erlang_mod.c
+++ b/src/modules/erlang/erlang_mod.c
@@ -697,7 +697,6 @@ static int fixup_rpc(void** param, int param_no)
if (psp->setf != pv_list_set && psp->setf != pv_xbuff_set) {
LM_ERR("wrong parameter #%d: accepted types are list or
xbuff\n",param_no);
- pv_spec_free(&erl_param->value.sp);
pkg_free((void*)erl_param);
return E_UNSPEC;
}
@@ -916,7 +915,6 @@ static int fixup_reg(void** param, int param_no)
erl_param->type = ERL_PARAM_XBUFF_SPEC;
} else {
LM_ERR("wrong parameter #%d\n",param_no);
- pv_spec_free(&erl_param->value.sp);
pkg_free((void*)erl_param);
return E_UNSPEC;
}
@@ -1111,7 +1109,6 @@ static int fixup_reply(void** param, int param_no)
erl_param->type = ERL_PARAM_XBUFF_SPEC;
} else {
LM_ERR("wrong parameter #%d\n",param_no);
- pv_spec_free(&erl_param->value.sp);
pkg_free((void*)erl_param);
return E_UNSPEC;
}
@@ -1376,7 +1373,6 @@ static int fixup_send(void** param, int param_no)
erl_param->type = ERL_PARAM_XBUFF_SPEC;
} else {
LM_ERR("wrong parameter #%d\n",param_no);
- pv_spec_free(&erl_param->value.sp);
pkg_free((void*)erl_param);
return E_UNSPEC;
}