From: Vsevolod Stakhov Date: Wed, 8 Oct 2014 15:29:51 +0000 (+0100) Subject: Print filename properly. X-Git-Tag: 0.7.2~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=10acf9beeee22af3703f84315635dd51858a3290;p=rspamd.git Print filename properly. --- diff --git a/src/client/rspamc.c b/src/client/rspamc.c index 3107c74f4..d2efc6ab4 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -252,7 +252,7 @@ struct rspamc_command { struct rspamc_callback_data { struct rspamc_command *cmd; - const gchar *filename; + gchar *filename; }; /* @@ -778,6 +778,7 @@ rspamc_client_cb (struct rspamd_client_connection *conn, fflush (stdout); rspamd_client_destroy (conn); + g_free (cbdata->filename); g_slice_free1 (sizeof (struct rspamc_callback_data), cbdata); } @@ -815,7 +816,7 @@ rspamc_process_input (struct event_base *ev_base, struct rspamc_command *cmd, if (conn != NULL) { cbdata = g_slice_alloc (sizeof (struct rspamc_callback_data)); cbdata->cmd = cmd; - cbdata->filename = name; + cbdata->filename = g_strdup (name); if (cmd->need_input) { rspamd_client_command (conn, cmd->path, attrs, in, rspamc_client_cb, cbdata, &err);