diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-27 15:08:56 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-27 15:08:56 +0000 |
commit | 58ed8f52a4fa827c8a63bfacfa69d342394fb7fe (patch) | |
tree | 116375d04787e7f42fb58309c5fdfcfe8e82ce32 | |
parent | c1eb73f580c7c47b8e71e2b9a0f88c9f1658cb7b (diff) | |
download | rspamd-58ed8f52a4fa827c8a63bfacfa69d342394fb7fe.tar.gz rspamd-58ed8f52a4fa827c8a63bfacfa69d342394fb7fe.zip |
Fix some syntax issues.
-rw-r--r-- | src/libserver/cfg_rcl.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index 5ffd07ced..0de3f6a1e 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -681,6 +681,7 @@ rspamd_rcl_lua_handler (struct rspamd_config *cfg, const ucl_object_t *obj, tmp2 = g_strdup (lua_src); lua_dir = dirname (tmp1); lua_file = basename (tmp2); + if (lua_dir && lua_file) { cur_dir = g_malloc (PATH_MAX); if (getcwd (cur_dir, PATH_MAX) != NULL && chdir (lua_dir) != -1) { @@ -694,7 +695,7 @@ rspamd_rcl_lua_handler (struct rspamd_config *cfg, const ucl_object_t *obj, lua_tostring (L, -1)); if (chdir (cur_dir) == -1) { msg_err ("cannot chdir to %s: %s", cur_dir, - strerror (errno));; + strerror (errno)); } g_free (cur_dir); g_free (tmp1); @@ -712,7 +713,7 @@ rspamd_rcl_lua_handler (struct rspamd_config *cfg, const ucl_object_t *obj, lua_tostring (L, -1)); if (chdir (cur_dir) == -1) { msg_err ("cannot chdir to %s: %s", cur_dir, - strerror (errno));; + strerror (errno)); } g_free (cur_dir); g_free (tmp1); @@ -724,7 +725,7 @@ rspamd_rcl_lua_handler (struct rspamd_config *cfg, const ucl_object_t *obj, g_set_error (err, CFG_RCL_ERROR, ENOENT, "cannot chdir to %s: %s", lua_src, strerror (errno)); if (chdir (cur_dir) == -1) { - msg_err ("cannot chdir to %s: %s", cur_dir, strerror (errno));; + msg_err ("cannot chdir to %s: %s", cur_dir, strerror (errno)); } g_free (cur_dir); g_free (tmp1); @@ -733,13 +734,15 @@ rspamd_rcl_lua_handler (struct rspamd_config *cfg, const ucl_object_t *obj, } if (chdir (cur_dir) == -1) { - msg_err ("cannot chdir to %s: %s", cur_dir, strerror (errno));; + msg_err ("cannot chdir to %s: %s", cur_dir, strerror (errno)); } g_free (cur_dir); g_free (tmp1); g_free (tmp2); } else { + g_free (tmp1); + g_free (tmp2); g_set_error (err, CFG_RCL_ERROR, ENOENT, "cannot find to %s: %s", lua_src, strerror (errno)); return FALSE; |