[Commits] [SCM] claws branch, master, updated. 3.18.0-206-g6a0dae093
wwp at claws-mail.org
wwp at claws-mail.org
Wed Sep 29 16:45:29 CEST 2021
The branch, master has been updated
via 6a0dae093b93a2de10034aa1cad6a11c47456e27 (commit)
from ca35e90da12bdbd5b14930ef8bd4d48b53770848 (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 6a0dae093b93a2de10034aa1cad6a11c47456e27
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 abc093933..9c07fbec2 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 e3167755e..986cec09e 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -968,6 +968,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;
}
@@ -1900,6 +1901,8 @@ gboolean vcal_meeting_export_calendar(const gchar *path,
_("There is nothing to export."),
GTK_STOCK_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);
@@ -1939,6 +1942,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);
@@ -1960,6 +1964,7 @@ putfile:
if (automatic && (!path || strlen(path) == 0 || !vcalprefs.export_enable)) {
g_free(tmpfile);
+ g_free(internal_file);
g_free(file);
return TRUE;
}
@@ -1970,7 +1975,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);
@@ -1982,7 +1987,6 @@ putfile:
res = FALSE;
}
g_free(afile);
- g_free(file);
} else if (file) {
FILE *fp = claws_fopen(tmpfile, "rb");
if (!strncmp(file, "webcal", 6)) {
@@ -1994,9 +1998,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 fbb779b0c..7a02b99af 100644
--- a/src/plugins/vcalendar/vcalendar.c
+++ b/src/plugins/vcalendar/vcalendar.c
@@ -555,17 +555,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);
@@ -735,6 +732,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