talons

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

commit 0a7dc16bb5fb197adf58032a5899a4021c48dea0
parent 94fd0bbfab005b65eeef1167e43b05d735b53d7b
Author: Ricardo Mones <ricardo@mones.org>
Date:   Sun,  9 Jun 2024 10:59:23 +0200

Fix CID 1596595: Resource leak

Diffstat:
Msrc/compose.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/compose.c b/src/compose.c @@ -11002,6 +11002,7 @@ int attach_image(Compose *compose, GtkSelectionData *data, const gchar *subtype) { FILE *fp; const guchar *contents; + gchar *tmpf; gchar *file; gchar *type; size_t len; @@ -11012,7 +11013,9 @@ int attach_image(Compose *compose, GtkSelectionData *data, const gchar *subtype) contents = gtk_selection_data_get_data(data); len = gtk_selection_data_get_length(data); - file = g_strconcat(get_tmp_file(), "-image.", subtype, NULL); + tmpf = get_tmp_file(); + file = g_strconcat(tmpf, "-image.", subtype, NULL); + g_free(tmpf); debug_print("writing image to %s\n", file);