guint i;
rspamd_regexp_t *re;
struct rspamd_http_connection_router *router;
+ gchar *pathbuf = NULL;
G_STATIC_ASSERT (sizeof (rspamd_http_router_handler_t) ==
sizeof (gpointer));
/* Search for path */
if (msg->url != NULL && msg->url->len != 0) {
- gchar *pathbuf = NULL;
http_parser_parse_url (msg->url->str, msg->url->len, TRUE, &u);
found = g_hash_table_lookup (entry->rt->paths, &lookup);
memcpy (&handler, &found, sizeof (found));
msg_debug ("requested known path: %T", &lookup);
-
- if (pathbuf) {
- g_free (pathbuf);
- }
}
else {
err = g_error_new (HTTP_ERROR, 404,
}
if (handler != NULL) {
+ if (pathbuf) {
+ g_free (pathbuf);
+ }
+
return handler (entry, msg);
}
else {
found = rspamd_regexp_get_ud (re);
memcpy (&handler, &found, sizeof (found));
+ if (pathbuf) {
+ g_free (pathbuf);
+ }
+
return handler (entry, msg);
}
}
}
}
+ if (pathbuf) {
+ g_free (pathbuf);
+ }
+
return 0;
}