Module: kamailio Branch: 5.1 Commit: 4d8e0755ba8169e8d5655d5b571a02d6c8ac6afb URL: https://github.com/kamailio/kamailio/commit/4d8e0755ba8169e8d5655d5b571a02d6...
Author: Seudin Kasumovic seudin.kasumovic@gmail.com Committer: Seudin Kasumovic seudin.kasumovic@gmail.com Date: 2018-01-04T09:23:30+01:00
erlang: fix memory leaks
Ensure free used memory if parse of params failed.
(cherry picked from commit 074eda76b3c2cb418832fd4b24436bf7f109b89e)
---
Modified: src/modules/erlang/erlang_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/4d8e0755ba8169e8d5655d5b571a02d6... Patch: https://github.com/kamailio/kamailio/commit/4d8e0755ba8169e8d5655d5b571a02d6...
---
diff --git a/src/modules/erlang/erlang_mod.c b/src/modules/erlang/erlang_mod.c index 2753842967..1c3c12efeb 100644 --- a/src/modules/erlang/erlang_mod.c +++ b/src/modules/erlang/erlang_mod.c @@ -666,6 +666,7 @@ static int fixup_rpc(void** param, int param_no) if(param_no==1 || param_no==2) { if (fix_param_types(FPARAM_STR|FPARAM_STRING|FPARAM_AVP|FPARAM_PVS|FPARAM_PVE,param)){ LM_ERR("wrong parameter #%d\n",param_no); + pkg_free((void*)erl_param); return -1; } erl_param->type = ERL_PARAM_FPARAM; @@ -873,6 +874,7 @@ static int fixup_reg(void** param, int param_no) if(param_no==1) { if (fix_param_types(FPARAM_STR|FPARAM_STRING|FPARAM_AVP|FPARAM_PVS|FPARAM_PVE|FPARAM_INT,param)){ LM_ERR("wrong parameter #%d\n",param_no); + pkg_free((void*)erl_param); return -1; } erl_param->type = ERL_PARAM_FPARAM;