aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-13 15:01:18 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-13 15:01:55 +0000
commitf7aee39a9dc81ae437e1dcc651a7335a7ae071d3 (patch)
tree491a5422b5e32feabad05fca0cdb9ae196f731a5 /src/libmime
parent376b5cac00888b7d3203f2c3e5611b0d25044c6b (diff)
downloadrspamd-f7aee39a9dc81ae437e1dcc651a7335a7ae071d3.tar.gz
rspamd-f7aee39a9dc81ae437e1dcc651a7335a7ae071d3.zip
[Fix] Fix various issues found by PVS Studio
https://www.viva64.com/
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/archives.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libmime/archives.c b/src/libmime/archives.c
index f546570a9..b84670761 100644
--- a/src/libmime/archives.c
+++ b/src/libmime/archives.c
@@ -1146,12 +1146,14 @@ rspamd_7zip_read_coders_info (struct rspamd_task *task,
return NULL;
}
- folder_nstreams = g_alloca (sizeof (int) * num_folders);
+ folder_nstreams = g_malloc (sizeof (int) * num_folders);
for (i = 0; i < num_folders && p != NULL && p < end; i++) {
p = rspamd_7zip_read_folder (task, p, end, arch,
&folder_nstreams[i], &num_digests);
}
+
+ g_free (folder_nstreams);
}
break;
case kCodersUnPackSize:
@@ -1499,6 +1501,7 @@ rspamd_7zip_read_files_info (struct rspamd_task *task,
if (fend == NULL || fend - p == 0) {
/* Crap instead of fname */
msg_debug_archive ("bad 7zip name; %s", G_STRLOC);
+ goto end;
}
res = rspamd_7zip_ucs2_to_utf8 (task, p, fend);