[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-254-gb0a8b7617

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


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

Summary of changes:
 src/plugins/pgpinline/pgpinline.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


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

    Fix CID 1492200 and 1491225: resource leaks.

diff --git a/src/plugins/pgpinline/pgpinline.c b/src/plugins/pgpinline/pgpinline.c
index 35ca8f8af..9b81fdcc9 100644
--- a/src/plugins/pgpinline/pgpinline.c
+++ b/src/plugins/pgpinline/pgpinline.c
@@ -72,6 +72,7 @@ static PrivacyDataPGP *pgpinline_new_privacydata()
 	data->sigstatus = NULL;
 	if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
 		debug_print(("Couldn't initialize GPG context, %s\n"), gpgme_strerror(err));
+        g_free(data);
 		return NULL;
 	}
 	
@@ -657,6 +658,7 @@ static gboolean pgpinline_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;
@@ -667,13 +669,13 @@ static gboolean pgpinline_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);
 		kset[i] = key;
 		i++;
 	}
-	
 
 	debug_print("Encrypting message content\n");
 
@@ -684,6 +686,7 @@ static gboolean pgpinline_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 			debug_print("msgcontent->node->children NULL, bailing\n");
 			privacy_set_error(_("Malformed message"));
 			g_free(kset);
+			g_free(fprs);
 			return FALSE;
 		}
 		msgcontent = (MimeInfo *) msgcontent->node->children->data;
@@ -696,6 +699,7 @@ static gboolean pgpinline_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 		privacy_set_error(_("Couldn't create temporary file, %s"), g_strerror(errno));
 		perror("my_tmpfile");
 		g_free(kset);
+		g_free(fprs);
 		return FALSE;
 	}
 	procmime_write_mimeinfo(msgcontent, fp);
@@ -713,6 +717,7 @@ static gboolean pgpinline_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;
 	}
 	gpgme_set_armor(ctx, 1);
@@ -729,6 +734,7 @@ static gboolean pgpinline_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 		g_free(textstr);
 		gpgme_release(ctx);
 		g_free(enccontent);
+		g_free(fprs);
 		return FALSE;
 	}
 
@@ -751,6 +757,8 @@ static gboolean pgpinline_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 	g_free(tmp);
 	gpgme_release(ctx);
 
+	g_free(fprs);
+
 	return TRUE;
 }
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list