[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-263-g7d41ed5f8
wwp at claws-mail.org
wwp at claws-mail.org
Wed Sep 29 16:17:55 CEST 2021
The branch, gtk3 has been updated
via 7d41ed5f856406ed141cb26c05513b931f613e96 (commit)
from 42d7514b2af10ea7784cd8196d153d01f88efa0e (commit)
Summary of changes:
src/plugins/archive/libarchive_archive.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
- Log -----------------------------------------------------------------
commit 7d41ed5f856406ed141cb26c05513b931f613e96
Author: wwp <subscript at free.fr>
Date: Wed Sep 29 16:17:41 2021 +0200
Fix CID 1491162, 1491183, 1491321 and 1491257: resource leaks.
diff --git a/src/plugins/archive/libarchive_archive.c b/src/plugins/archive/libarchive_archive.c
index 431458333..807006d2b 100644
--- a/src/plugins/archive/libarchive_archive.c
+++ b/src/plugins/archive/libarchive_archive.c
@@ -64,7 +64,10 @@ static int permissions = 0;
static void free_msg_trash(MsgTrash* trash) {
if (trash) {
- debug_print("Freeing files in %s\n", folder_item_get_name(trash->item));
+ gchar *name = folder_item_get_name(trash->item);
+
+ debug_print("Freeing files in %s\n", name);
+ g_free(name);
if (trash->msgs) {
g_slist_free(trash->msgs);
}
@@ -97,9 +100,11 @@ void archive_free_archived_files() {
GSList* l = NULL;
for (l = msg_trash_list; l; l = g_slist_next(l)) {
+ gchar *name = folder_item_get_name(mt->item);
mt = (MsgTrash *) l->data;
debug_print("Trashing messages in folder: %s\n",
- folder_item_get_name(mt->item));
+ name);
+ g_free(name);
res = folder_item_remove_msgs(mt->item, mt->msgs);
debug_print("Result was %d\n", res);
free_msg_trash(mt);
@@ -149,7 +154,7 @@ static gboolean is_iso_string(gchar** items) {
static GDate* iso2GDate(const gchar* date) {
GDate* gdate;
- gchar** parts = NULL;
+ gchar** parts;
int i;
g_return_val_if_fail(date != NULL, NULL);
@@ -158,8 +163,10 @@ static GDate* iso2GDate(const gchar* date) {
parts = g_strsplit(date, "-", 3);
if (!parts)
return NULL;
- if (! is_iso_string(parts))
+ if (! is_iso_string(parts)) {
+ free_all(gdate, parts);
return NULL;
+ }
for (i = 0; i < 3; i++) {
int t = atoi(parts[i]);
switch (i) {
@@ -606,6 +613,7 @@ const gchar* archive_create(const char* archive_name, GSList* files,
buf = g_file_read_link(filename, &err);
if (err) {
FILE_OP_ERROR(filename, "g_file_read_link");
+ g_clear_error(&err);
} else {
archive_entry_set_symlink(entry, buf);
g_free(buf);
@@ -629,8 +637,11 @@ const gchar* archive_create(const char* archive_name, GSList* files,
}
archive_entry_free(entry);
}
- if (!g_close(fd, &err) || err)
+ if (!g_close(fd, &err) || err) {
FILE_OP_ERROR(filename, "g_close");
+ if (err)
+ g_clear_error(&err);
+ }
}
}
g_free(filename);
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list