From: Vsevolod Stakhov Date: Tue, 13 Oct 2015 16:03:33 +0000 (+0100) Subject: Fix handling of custom commands. X-Git-Tag: 1.0.5~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9aac6193c2265ea954fbddd5b3a98ebf0026101f;p=rspamd.git Fix handling of custom commands. --- diff --git a/src/controller.c b/src/controller.c index 32b170b76..534db37e8 100644 --- a/src/controller.c +++ b/src/controller.c @@ -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");