diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-03-09 14:27:38 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-03-09 14:27:38 +0000 |
commit | 2823044f85ec1bf8c4cdcb3244e89f4750cf909e (patch) | |
tree | 3faee150f5ac1d36d83fd71b99b6fe2a5dc3bb92 /src | |
parent | 16f7461d83f9caa13bd2bc71a59a3f5c7b55710d (diff) | |
download | rspamd-2823044f85ec1bf8c4cdcb3244e89f4750cf909e.tar.gz rspamd-2823044f85ec1bf8c4cdcb3244e89f4750cf909e.zip |
[Fix] Plug memory leak in lua_fann
Diffstat (limited to 'src')
-rw-r--r-- | src/lua/lua_fann.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lua/lua_fann.c b/src/lua/lua_fann.c index e838e2e30..b2bd5ba86 100644 --- a/src/lua/lua_fann.c +++ b/src/lua/lua_fann.c @@ -300,7 +300,7 @@ lua_fann_test (lua_State *L) } } - cur_input = g_malloc (ninputs * sizeof (gint)); + cur_input = g_slice_alloc (ninputs * sizeof (gint)); for (i = 0; i < ninputs; i++) { lua_rawgeti (L, tbl_idx, i + 1); @@ -316,6 +316,8 @@ lua_fann_test (lua_State *L) lua_pushnumber (L, cur_output[i]); lua_rawseti (L, -2, i + 1); } + + g_slice_free1 (ninputs * sizeof (gint), cur_input); } else { lua_pushnil (L); |