]> source.dussan.org Git - rspamd.git/commitdiff
Fix segfault in a client when controller disappears.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 28 May 2013 16:35:58 +0000 (17:35 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 28 May 2013 16:35:58 +0000 (17:35 +0100)
src/client/rspamc.c

index 18046f0d216bab61fa4fdb73b042a6ce7b8935c4..940f3942c5e606ca7181215d87140b0562d904a9 100644 (file)
@@ -651,7 +651,12 @@ rspamd_do_controller_simple_command (gchar *command, GHashTable *kwattrs)
                        if (tty) {
                                printf ("\033[0m");
                        }
-                       PRINT_FUNC ("%*s\n", (gint)res->data->len, res->data->str);
+                       if (res->data) {
+                               PRINT_FUNC ("%*s\n", (gint)res->data->len, res->data->str);
+                       }
+                       else {
+                               PRINT_FUNC ("No results\n");
+                       }
                        rspamd_free_controller_result (res);
                        cur = g_list_next (cur);
                }