From c0b3a6d5baa43933e88a637f0a4d2298b50b9b41 Mon Sep 17 00:00:00 2001 From: wwp Date: Tue, 28 Sep 2021 17:13:07 +0200 Subject: [PATCH] Fix CID 1491066: resource leak. --- src/plugins/clamd/clamav_plugin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/clamd/clamav_plugin.c b/src/plugins/clamd/clamav_plugin.c index b49548022..ef650e79c 100644 --- a/src/plugins/clamd/clamav_plugin.c +++ b/src/plugins/clamd/clamav_plugin.c @@ -86,7 +86,7 @@ static gboolean scan_func(GNode *node, gpointer data) response buf; int max; GStatBuf info; - gchar* msg; + gchar* msg, *name; outfile = procmime_get_tmp_file_name(mimeinfo); if (procmime_get_part(outfile, mimeinfo) < 0) @@ -116,8 +116,10 @@ static gboolean scan_func(GNode *node, gpointer data) } break; case VIRUS: + name = clamd_get_virus_name(buf.msg); msg = g_strconcat(_("Detected %s virus."), - clamd_get_virus_name(buf.msg), NULL); + name, NULL); + g_free(name); g_warning("%s", msg); debug_print("no_recv: %d\n", prefs_common_get_prefs()->no_recv_err_panel); if (prefs_common_get_prefs()->no_recv_err_panel) { -- 2.25.1