From: Vsevolod Stakhov Date: Tue, 28 May 2013 16:35:58 +0000 (+0100) Subject: Fix segfault in a client when controller disappears. X-Git-Tag: 0.5.5~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b306cfe8d5c6407520978902e251e36ddc901725;p=rspamd.git Fix segfault in a client when controller disappears. --- diff --git a/src/client/rspamc.c b/src/client/rspamc.c index 18046f0d2..940f3942c 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -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); }