[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-264-gf73d8e932
wwp at claws-mail.org
wwp at claws-mail.org
Wed Sep 29 16:45:35 CEST 2021
The branch, gtk3 has been updated
via f73d8e93287e45bd516bbc8f4ed9e4a6605e3d0f (commit)
from 7d41ed5f856406ed141cb26c05513b931f613e96 (commit)
Summary of changes:
src/plugins/vcalendar/vcal_folder.c | 4 +++-
src/plugins/vcalendar/vcal_meeting_gtk.c | 11 ++++++++---
src/plugins/vcalendar/vcalendar.c | 13 ++++++-------
3 files changed, 17 insertions(+), 11 deletions(-)
- Log -----------------------------------------------------------------
commit f73d8e93287e45bd516bbc8f4ed9e4a6605e3d0f
Author: wwp <subscript at free.fr>
Date: Wed Sep 29 16:45:19 2021 +0200
Fix CID 1491106, 1491129, 1491163, 1491231, 1491329 and 1491353: resource leaks.
diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c
index 86ea99527..161796ebc 100644
--- a/src/plugins/vcalendar/vcal_folder.c
+++ b/src/plugins/vcalendar/vcal_folder.c
@@ -2492,8 +2492,10 @@ gchar* vcal_add_event(const gchar *vevent)
VCalEvent *event = vcal_get_event_from_ical(vevent, NULL);
gchar *retVal = NULL;
Folder *folder = folder_find_from_name (PLUGIN_NAME, vcal_folder_get_class());
- if (!folder)
+ if (!folder) {
+ vcal_manager_free_event(event);
return NULL;
+ }
if (event) {
if (vcal_event_exists(event->uid)) {
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index cbac831cb..cc382f4d9 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -980,6 +980,7 @@ static gboolean check_attendees_availability(VCalMeeting *meet, gboolean tell_if
if (num_format > 2) {
g_warning("wrong format in %s!", real_url);
g_free(real_url);
+ g_free(internal_ifb);
return FALSE;
}
@@ -1914,6 +1915,8 @@ gboolean vcal_meeting_export_calendar(const gchar *path,
_("There is nothing to export."),
_("_OK"), NULL, NULL, ALERTFOCUS_FIRST, FALSE,
NULL, ALERT_NOTICE);
+ g_free(tmpfile);
+ g_free(internal_file);
return FALSE;
} else {
str_write_to_file("", tmpfile, TRUE);
@@ -1953,6 +1956,7 @@ gboolean vcal_meeting_export_calendar(const gchar *path,
if (str_write_to_file(icalcomponent_as_ical_string(calendar), tmpfile, TRUE) < 0) {
alertpanel_error(_("Could not export the calendar."));
g_free(tmpfile);
+ g_free(internal_file);
icalcomponent_free(calendar);
g_slist_free(list);
g_slist_free(subs);
@@ -1974,6 +1978,7 @@ putfile:
if (automatic && (!path || strlen(path) == 0 || !vcalprefs.export_enable)) {
g_free(tmpfile);
+ g_free(internal_file);
g_free(file);
return TRUE;
}
@@ -1984,7 +1989,7 @@ putfile:
&& strncmp(file, "webcal://", 9)
&& strncmp(file, "webcals://", 10)
&& strncmp(file, "ftp://", 6)) {
- gchar *afile = NULL;
+ gchar *afile;
if (file[0] != G_DIR_SEPARATOR)
afile=g_strdup_printf("%s%s%s", get_home_dir(),
G_DIR_SEPARATOR_S, file);
@@ -1996,7 +2001,6 @@ putfile:
res = FALSE;
}
g_free(afile);
- g_free(file);
} else if (file) {
FILE *fp = claws_fopen(tmpfile, "rb");
if (!strncmp(file, "webcal", 6)) {
@@ -2008,9 +2012,10 @@ putfile:
res = vcal_curl_put(file, fp, filesize, user, (pass != NULL ? pass : ""));
claws_fclose(fp);
}
- g_free(file);
}
g_free(tmpfile);
+ g_free(internal_file);
+ g_free(file);
return res;
}
diff --git a/src/plugins/vcalendar/vcalendar.c b/src/plugins/vcalendar/vcalendar.c
index 0186358c4..bfb131db9 100644
--- a/src/plugins/vcalendar/vcalendar.c
+++ b/src/plugins/vcalendar/vcalendar.c
@@ -552,17 +552,14 @@ void vcalviewer_display_event (VCalViewer *vcalviewer, VCalEvent *event)
/* start */
if (event->start && *(event->start)) {
if (event->recur && *(event->recur)) {
- gchar *tmp = g_strdup_printf(g_strconcat("%s <span weight=\"bold\">",
- _("(this event recurs)"),"</span>", NULL),
- event->start);
+ gchar *tmp = g_strdup_printf("%s <span weight=\"bold\">%s</span>",
+ _("(this event recurs)"), event->start);
GTK_LABEL_SET_TEXT_TRIMMED(GTK_LABEL(vcalviewer->start), tmp);
gtk_label_set_use_markup(GTK_LABEL(vcalviewer->start), TRUE);
g_free(tmp);
} else if (event->rec_occurrence) {
- gchar *tmp = g_strdup_printf(g_strconcat("%s <span weight=\"bold\">",
- _("(this event is part of a recurring event)"),
- "</span>", NULL),
- event->start);
+ gchar *tmp = g_strdup_printf("%s <span weight=\"bold\">%s</span>",
+ _("(this event is part of a recurring event)"), event->start);
GTK_LABEL_SET_TEXT_TRIMMED(GTK_LABEL(vcalviewer->start), tmp);
gtk_label_set_use_markup(GTK_LABEL(vcalviewer->start), TRUE);
g_free(tmp);
@@ -732,6 +729,8 @@ static void vcalviewer_get_reply_values(VCalViewer *vcalviewer, MimeInfo *mimein
vcalviewer_display_event(vcalviewer, saved_event);
vcal_manager_free_event(saved_event);
return;
+ } else if (saved_event) {
+ vcal_manager_free_event(saved_event);
}
if (vcalviewer->event->organizer) {
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list