aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-05-28 17:35:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-05-28 17:35:58 +0100
commitb306cfe8d5c6407520978902e251e36ddc901725 (patch)
tree8d2d9d0449c5d4dbdc3a987365bb4ee42055d69a
parenta658ca6e8bc22d6dcdd4bf2148b1efcaa2b136be (diff)
downloadrspamd-b306cfe8d5c6407520978902e251e36ddc901725.tar.gz
rspamd-b306cfe8d5c6407520978902e251e36ddc901725.zip
Fix segfault in a client when controller disappears.
-rw-r--r--src/client/rspamc.c7
1 files changed, 6 insertions, 1 deletions
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);
}