aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-10-04 15:57:23 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-10-04 15:57:23 +0400
commitd162849fae30115e87ce4f745208f55bd72a22cd (patch)
treecb48b8196fd3a167b84d2f496988f9e5defcf63a /src/lua
parent6493d8b379680743c0dd5989332cf7364d49649e (diff)
downloadrspamd-d162849fae30115e87ce4f745208f55bd72a22cd.tar.gz
rspamd-d162849fae30115e87ce4f745208f55bd72a22cd.zip
Check if internet address list is parsed correctly.
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_task.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index eb6ba2690..6552b703e 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -827,12 +827,18 @@ lua_task_get_from (lua_State *L)
#else
addrs = internet_address_list_parse_string (task->from);
#endif
- lua_push_internet_address_list (L, addrs);
+ if (L != NULL) {
+ lua_push_internet_address_list (L, addrs);
#ifndef GMIME24
- internet_address_list_destroy (addrs);
+ internet_address_list_destroy (addrs);
#else
- g_object_unref (addrs);
+ g_object_unref (addrs);
#endif
+ }
+ else {
+ lua_pushnil (L);
+ }
+
return 1;
}
}