[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-245-g5b993515c

wwp at claws-mail.org wwp at claws-mail.org
Tue Sep 28 14:45:46 CEST 2021


The branch, gtk3 has been updated
       via  5b993515c033ddd2beacb54985b2dd3557629e8f (commit)
      from  7e51f51b5992a4d6c5821c1c23032b5ae9a1ca6c (commit)

Summary of changes:
 src/plugins/smime/smime.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 5b993515c033ddd2beacb54985b2dd3557629e8f
Author: wwp <subscript at free.fr>
Date:   Tue Sep 28 14:45:12 2021 +0200

    Fix CID 1491069 and 1491256: resource leaks.

diff --git a/src/plugins/smime/smime.c b/src/plugins/smime/smime.c
index b8905f3ae..976039486 100644
--- a/src/plugins/smime/smime.c
+++ b/src/plugins/smime/smime.c
@@ -744,6 +744,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 
 	if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
 		debug_print ("gpgme_new failed: %s\n", gpgme_strerror(err));
+		g_free(fprs);
 		return FALSE;
 	}
 
@@ -752,6 +753,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 	if (err) {
 		debug_print ("gpgme_set_protocol failed: %s\n",
                    gpgme_strerror (err));
+		g_free(fprs);
 		return FALSE;
 	}
 
@@ -771,7 +773,8 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 		kset[i] = key;
 		i++;
 	}
-	
+	g_free(fprs);
+
 	debug_print("Encrypting message content\n");
 
 	/* remove content node from message */
@@ -801,6 +804,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 	if (fp == NULL) {
 		FILE_OP_ERROR(tmpfile, "create");
 		g_free(kset);
+		g_free(tmpfile);
 		return FALSE;
 	}
 	procmime_decode_content(msgcontent);
@@ -812,6 +816,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 	if (fp == NULL) {
 		FILE_OP_ERROR(tmpfile, "open");
 		g_free(kset);
+		g_free(tmpfile);
 		return FALSE;
 	}
 	g_free(tmpfile);
@@ -846,7 +851,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 			claws_unlink(tmpfile);
 			g_free(tmpfile);
 			g_free(enccontent);
-			return FALSE;
+			g_free(tmpfile);
 		}
 		if (claws_safe_fclose(fp) == EOF) {
 			FILE_OP_ERROR(tmpfile, "claws_fclose");

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list