]> source.dussan.org Git - rspamd.git/commitdiff
Check if internet address list is parsed correctly.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 4 Oct 2011 11:57:23 +0000 (15:57 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 4 Oct 2011 11:57:23 +0000 (15:57 +0400)
src/lua/lua_task.c

index eb6ba26908370b88a49f29c85f997b832149e9db..6552b703e3b329336d3b05ebb28d056fa98b294c 100644 (file)
@@ -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;
                }
        }