aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-13 15:01:18 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-13 15:01:55 +0000
commitf7aee39a9dc81ae437e1dcc651a7335a7ae071d3 (patch)
tree491a5422b5e32feabad05fca0cdb9ae196f731a5 /src/lua/lua_common.c
parent376b5cac00888b7d3203f2c3e5611b0d25044c6b (diff)
downloadrspamd-f7aee39a9dc81ae437e1dcc651a7335a7ae071d3.tar.gz
rspamd-f7aee39a9dc81ae437e1dcc651a7335a7ae071d3.zip
[Fix] Fix various issues found by PVS Studio
https://www.viva64.com/
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r--src/lua/lua_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index 737455a3c..cff684aad 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -1940,7 +1940,6 @@ rspamd_lua_execute_lua_subprocess (lua_State *L,
msg_err ("call to subprocess failed: %v", tb);
/* Indicate error */
wlen = (1ULL << 63) + tb->len;
- g_string_free (tb, TRUE);
r = write (cbdata->sp[1], &wlen, sizeof (wlen));
if (r == -1) {
@@ -1951,6 +1950,7 @@ rspamd_lua_execute_lua_subprocess (lua_State *L,
if (r == -1) {
msg_err ("write failed: %s", strerror (errno));
}
+ g_string_free (tb, TRUE);
lua_pop (L, 1);
}
@@ -2205,9 +2205,9 @@ lua_worker_spawn_process (lua_State *L)
if (rspamd_socketpair (cbdata->sp, TRUE) == -1) {
msg_err ("cannot spawn socketpair: %s", strerror (errno));
- g_free (cbdata);
luaL_unref (L, LUA_REGISTRYINDEX, cbdata->func_cbref);
luaL_unref (L, LUA_REGISTRYINDEX, cbdata->cb_cbref);
+ g_free (cbdata);
return 0;
}