From: Vsevolod Stakhov Date: Mon, 26 Sep 2016 10:02:33 +0000 (+0100) Subject: [Fix] Fix memory leak in client when using compression X-Git-Tag: 1.4.0~375 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=443971e6d041b5da46a5c2c3a33fc0eb8bbc82a9;p=thirdparty%2Frspamd.git [Fix] Fix memory leak in client when using compression --- diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c index e71d5d3e00..d0b3151085 100644 --- a/src/client/rspamdclient.c +++ b/src/client/rspamdclient.c @@ -193,12 +193,12 @@ rspamd_client_finish_handler (struct rspamd_http_connection *conn, ucl_parser_free (parser); req->cb (c, msg, c->server_name->str, NULL, req->input, req->ud, err); g_error_free (err); - g_free (out); + g_free (zout.dst); return 0; } - g_free (out); + g_free (zout.dst); } else { err = g_error_new (RCLIENT_ERROR, 500, @@ -386,6 +386,7 @@ rspamd_client_command (struct rspamd_client_connection *conn, g_slice_free1 (sizeof (struct rspamd_client_request), req); g_string_free (input, TRUE); rspamd_fstring_free (body); + ZSTD_freeCCtx (zctx); return FALSE; } @@ -393,6 +394,7 @@ rspamd_client_command (struct rspamd_client_connection *conn, rspamd_http_message_set_body_from_fstring_steal (req->msg, body); req->input = input; + ZSTD_freeCCtx (zctx); } else { req->input = NULL;