commit 1700e5d7e56ca6f188d861a0548c8db20a031dde
parent 7ff97c375325b267a9374433c6b78ea7da648bbf
Author: Colin Leroy <colin@colino.net>
Date: Wed, 31 Aug 2011 18:39:50 +0000
2011-08-31 [colin] 3.7.10cvs14
* src/plugins/pgpinline/pgpinline.c
* src/plugins/pgpmime/pgpmime.c
Fix bug #2431, "Major memory leak in PGP message handling".
Diffstat:
5 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-31 [colin] 3.7.10cvs14
+
+ * src/plugins/pgpinline/pgpinline.c
+ * src/plugins/pgpmime/pgpmime.c
+ Fix bug #2431, "Major memory leak in PGP message handling".
+
2011-08-31 [colin] 3.7.10cvs13
* AUTHORS
diff --git a/PATCHSETS b/PATCHSETS
@@ -4217,3 +4217,4 @@
( cvs diff -u -r 1.654.2.4291 -r 1.654.2.4292 configure.ac; cvs diff -u -r 1.9.2.46 -r 1.9.2.47 src/common/ssl.c; ) > 3.7.10cvs11.patchset
( cvs diff -u -r 1.12.2.55 -r 1.12.2.56 src/gtk/prefswindow.c; ) > 3.7.10cvs12.patchset
( cvs diff -u -r 1.100.2.78 -r 1.100.2.79 AUTHORS; cvs diff -u -r 1.1.2.72 -r 1.1.2.73 src/gtk/authors.h; cvs diff -u -r 1.274.2.327 -r 1.274.2.328 src/mainwindow.c; cvs diff -u -r 1.94.2.217 -r 1.94.2.218 src/messageview.c; cvs diff -u -r 1.1.2.72 -r 1.1.2.73 src/gtk/authors.h; ) > 3.7.10cvs13.patchset
+( cvs diff -u -r 1.1.2.48 -r 1.1.2.49 src/plugins/pgpinline/pgpinline.c; cvs diff -u -r 1.1.2.58 -r 1.1.2.59 src/plugins/pgpmime/pgpmime.c; ) > 3.7.10cvs14.patchset
diff --git a/configure.ac b/configure.ac
@@ -12,7 +12,7 @@ MINOR_VERSION=7
MICRO_VERSION=10
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=13
+EXTRA_VERSION=14
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
diff --git a/src/plugins/pgpinline/pgpinline.c b/src/plugins/pgpinline/pgpinline.c
@@ -475,10 +475,12 @@ static MimeInfo *pgpinline_decrypt(MimeInfo *mimeinfo)
if (len > 0) {
if (fwrite(chars, 1, len, dstfp) < len) {
FILE_OP_ERROR(fname, "fwrite");
+ g_free(chars);
privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
goto FILE_ERROR;
}
}
+ g_free(chars);
/* Store any part after encrypted text */
if (fwrite(_("--- End of PGP/Inline encrypted data ---\n"), 1,
strlen(_("--- End of PGP/Inline encrypted data ---\n")),
diff --git a/src/plugins/pgpmime/pgpmime.c b/src/plugins/pgpmime/pgpmime.c
@@ -364,6 +364,7 @@ static MimeInfo *pgpmime_decrypt(MimeInfo *mimeinfo)
if (len > 0) {
if (fwrite(chars, 1, len, dstfp) < len) {
FILE_OP_ERROR(fname, "fwrite");
+ g_free(chars);
fclose(dstfp);
privacy_set_error(_("Couldn't write to decrypted file %s"), fname);
g_free(fname);
@@ -373,6 +374,8 @@ static MimeInfo *pgpmime_decrypt(MimeInfo *mimeinfo)
return NULL;
}
}
+ g_free(chars);
+
if (fclose(dstfp) == EOF) {
FILE_OP_ERROR(fname, "fclose");
privacy_set_error(_("Couldn't close decrypted file %s"), fname);