Module: kamailio
Branch: master
Commit: 4a480ba9745b6874f86808fc21dcd750e00febd3
URL:
https://github.com/kamailio/kamailio/commit/4a480ba9745b6874f86808fc21dcd75…
Author: Hugh Waite <que273(a)users.noreply.github.com>
Committer: Hugh Waite <que273(a)users.noreply.github.com>
Date: 2015-05-14T16:00:02+01:00
Merge pull request #162 from que273/master
app_lua: Fix memory leak in sr.modf
---
Modified: modules/app_lua/app_lua_sr.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4a480ba9745b6874f86808fc21dcd75…
Patch:
https://github.com/kamailio/kamailio/commit/4a480ba9745b6874f86808fc21dcd75…
---
diff --git a/modules/app_lua/app_lua_sr.c b/modules/app_lua/app_lua_sr.c
index 1eebdd1..e529421 100644
--- a/modules/app_lua/app_lua_sr.c
+++ b/modules/app_lua/app_lua_sr.c
@@ -265,6 +265,11 @@ static int lua_sr_modf (lua_State *L)
}
}
pkg_free(act);
+ for(i=0; i<MAX_ACTIONS; i++)
+ {
+ if(argv[i]!=NULL) pkg_free(argv[i]);
+ argv[i] = 0;
+ }
lua_pushinteger(L, ret);
return 1;