]> source.dussan.org Git - rspamd.git/commitdiff
Print filename properly.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 8 Oct 2014 15:29:51 +0000 (16:29 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 8 Oct 2014 15:29:51 +0000 (16:29 +0100)
src/client/rspamc.c

index 3107c74f493aa916b9c77ae55f7ca6768d376a05..d2efc6ab4ac6b53756e029d5f056cebc259c288e 100644 (file)
@@ -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);