]> source.dussan.org Git - rspamd.git/commitdiff
Fix handling of custom commands.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 13 Oct 2015 16:03:33 +0000 (17:03 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 13 Oct 2015 16:03:33 +0000 (17:03 +0100)
src/controller.c

index 32b170b7641226cf0a818fd77824dc3a9082c671..534db37e8ad52da0859b080e1ff291d122c0ade5 100644 (file)
@@ -1974,8 +1974,12 @@ rspamd_controller_handle_custom (struct rspamd_http_connection_entry *conn_ent,
 {
        struct rspamd_controller_session *session = conn_ent->ud;
        struct rspamd_custom_controller_command *cmd;
+       gchar *url_str;
+
+       url_str = rspamd_fstring_cstr (msg->url);
+       cmd = g_hash_table_lookup (session->ctx->custom_commands, url_str);
+       g_free (url_str);
 
-       cmd = g_hash_table_lookup (session->ctx->custom_commands, msg->url->str);
        if (cmd == NULL || cmd->handler == NULL) {
                msg_err_session ("custom command %V has not been found", msg->url);
                rspamd_controller_send_error (conn_ent, 404, "No command associated");