talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit ecb3e3e748be5a6e89056d31960abde19fe209bd
parent 15814dd06ce1461b1b52efc33ae6b0b7da7dd036
Author: wwp <subscript@free.fr>
Date:   Tue, 28 Sep 2021 17:13:07 +0200

Fix CID 1491066: resource leak.

Diffstat:
Msrc/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 @@ -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) {