Module: kamailio
Branch: master
Commit: 733f5ad7c9b2515c52b00875fb5dac689ddd9a17
URL:
https://github.com/kamailio/kamailio/commit/733f5ad7c9b2515c52b00875fb5dac6…
Author: Hugh Waite <hugh.waite(a)acision.com>
Committer: Hugh Waite <hugh.waite(a)acision.com>
Date: 2015-05-14T13:54:20+01:00
app_lua: Fix memory leak in sr.modf
- Free pkg memory allocated to store cloned function parameters
---
Modified: modules/app_lua/app_lua_sr.c
---
Diff:
https://github.com/kamailio/kamailio/commit/733f5ad7c9b2515c52b00875fb5dac6…
Patch:
https://github.com/kamailio/kamailio/commit/733f5ad7c9b2515c52b00875fb5dac6…
---
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;