From b306cfe8d5c6407520978902e251e36ddc901725 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 28 May 2013 17:35:58 +0100 Subject: Fix segfault in a client when controller disappears. --- src/client/rspamc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3