[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-253-g0c2412178

wwp at claws-mail.org wwp at claws-mail.org
Tue Sep 28 17:40:28 CEST 2021


The branch, gtk3 has been updated
       via  0c2412178404bc24de30b84e75fad4f5a73a1501 (commit)
      from  bbe3de93cd452d461ac905bdc22b7be064b73a78 (commit)

Summary of changes:
 src/plugins/pgpmime/pgpmime.c | 9 +++++++++
 1 file changed, 9 insertions(+)


- Log -----------------------------------------------------------------
commit 0c2412178404bc24de30b84e75fad4f5a73a1501
Author: wwp <subscript at free.fr>
Date:   Tue Sep 28 17:40:12 2021 +0200

    Fix CID 1492195, 1491196, 1491158 and 1491081: resource leaks.

diff --git a/src/plugins/pgpmime/pgpmime.c b/src/plugins/pgpmime/pgpmime.c
index e9cb47998..618bb6fa2 100644
--- a/src/plugins/pgpmime/pgpmime.c
+++ b/src/plugins/pgpmime/pgpmime.c
@@ -72,6 +72,7 @@ static PrivacyDataPGP *pgpmime_new_privacydata()
 	data->sigstatus = NULL;
 	if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
 		g_warning("couldn't initialize GPG context: %s", gpgme_strerror(err));
+        g_free(data);
 		return NULL;
 	}
 	
@@ -494,6 +495,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr
 	if (fp == NULL) {
 		perror("my_tmpfile");
 		privacy_set_error(_("Couldn't create temporary file: %s"), g_strerror(errno));
+		g_free(boundary);
 		return FALSE;
 	}
 	procmime_write_mimeinfo(sigmultipart, fp);
@@ -655,6 +657,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 		debug_print(("Couldn't initialize GPG context, %s\n"), gpgme_strerror(err));
 		privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
 		g_free(kset);
+		g_free(fprs);
 		return FALSE;
 	}
 	i = 0;
@@ -665,6 +668,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 			debug_print("can't add key '%s'[%d] (%s)\n", fprs[i],i, gpgme_strerror(err));
 			privacy_set_error(_("Couldn't add GPG key %s, %s"), fprs[i], gpgme_strerror(err));
 			g_free(kset);
+			g_free(fprs);
 			return FALSE;
 		}
 		debug_print("found %s at %d\n", fprs[i], i);
@@ -695,6 +699,8 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 		perror("my_tmpfile");
 		privacy_set_error(_("Couldn't create temporary file, %s"), g_strerror(errno));
 		g_free(kset);
+		g_free(boundary);
+		g_free(fprs);
 		return FALSE;
 	}
 	procmime_write_mimeinfo(encmultipart, fp);
@@ -724,6 +730,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 		privacy_set_error(_("Encryption failed, %s"), gpgme_strerror(err));
 		gpgme_release(ctx);
 		g_free(enccontent);
+		g_free(fprs);
 		return FALSE;
 	}
 
@@ -753,6 +760,8 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 	g_free(enccontent);
 	gpgme_release(ctx);
 
+	g_free(fprs);
+
 	return TRUE;
 }
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list