commit eb10a324d77b87df31bd5c7ebe8a64372eecf276
parent f26aa613c426ed26a45518dacfeff47ccb399fef
Author: Colin Leroy <colin@colino.net>
Date: Tue, 25 Jan 2011 17:01:01 +0000
2011-01-25 [colin] 3.7.8cvs46
* src/compose.c
* src/prefs_common.c
* src/common/md5.c
* src/common/ssl_certificate.c
Fix mismatched alloc/free (thanks to cppcheck)
Diffstat:
7 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,11 @@
+2011-01-25 [colin] 3.7.8cvs46
+
+ * src/compose.c
+ * src/prefs_common.c
+ * src/common/md5.c
+ * src/common/ssl_certificate.c
+ Fix mismatched alloc/free (thanks to cppcheck)
+
2011-01-25 [colin] 3.7.8cvs45
* src/pop.c
diff --git a/PATCHSETS b/PATCHSETS
@@ -4119,3 +4119,4 @@
( cvs diff -u -r 1.4.2.77 -r 1.4.2.78 src/gtk/about.c; ) > 3.7.8cvs43.patchset
( cvs diff -u -r 1.1.2.16 -r 1.1.2.17 manual/es/advanced.xml; ) > 3.7.8cvs44.patchset
( cvs diff -u -r 1.56.2.66 -r 1.56.2.67 src/pop.c; ) > 3.7.8cvs45.patchset
+( cvs diff -u -r 1.382.2.566 -r 1.382.2.567 src/compose.c; cvs diff -u -r 1.204.2.199 -r 1.204.2.200 src/prefs_common.c; cvs diff -u -r 1.2.2.9 -r 1.2.2.10 src/common/md5.c; cvs diff -u -r 1.4.2.36 -r 1.4.2.37 src/common/ssl_certificate.c; ) > 3.7.8cvs46.patchset
diff --git a/configure.ac b/configure.ac
@@ -12,7 +12,7 @@ MINOR_VERSION=7
MICRO_VERSION=8
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=45
+EXTRA_VERSION=46
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
diff --git a/src/common/md5.c b/src/common/md5.c
@@ -359,7 +359,7 @@ md5_hex_digest_file(char *hexdigest, const unsigned char *file)
if (fd == -1) {
FILE_OP_ERROR(file, "open");
- g_free(buf);
+ free(buf);
return -1;
}
diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c
@@ -493,8 +493,8 @@ static gboolean ssl_certificate_compare (SSLCertificate *cert_a, SSLCertificate
return FALSE;
}
- output_a = malloc(cert_size_a);
- output_b = malloc(cert_size_b);
+ output_a = g_malloc(cert_size_a);
+ output_b = g_malloc(cert_size_b);
if ((r = gnutls_x509_crt_export(cert_a->x509_cert, GNUTLS_X509_FMT_DER, output_a, &cert_size_a)) < 0) {
g_warning("couldn't gnutls_x509_crt_export a %s\n", gnutls_strerror(r));
g_free(output_a);
diff --git a/src/compose.c b/src/compose.c
@@ -991,7 +991,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
dummyinfo = compose_msginfo_new_from_compose(compose);
/* decode \-escape sequences in the internal representation of the quote format */
- tmp = malloc(strlen(item->prefs->compose_override_from_format)+1);
+ tmp = g_malloc(strlen(item->prefs->compose_override_from_format)+1);
pref_get_unescaped_pref(tmp, item->prefs->compose_override_from_format);
#ifdef USE_ENCHANT
@@ -1082,7 +1082,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
dummyinfo = compose_msginfo_new_from_compose(compose);
/* decode \-escape sequences in the internal representation of the quote format */
- tmp = malloc(strlen(subject_format)+1);
+ tmp = g_malloc(strlen(subject_format)+1);
pref_get_unescaped_pref(tmp, subject_format);
subject = gtk_editable_get_chars(GTK_EDITABLE(compose->subject_entry), 0, -1);
@@ -1548,7 +1548,7 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
gchar *buf = NULL;
/* decode \-escape sequences in the internal representation of the quote format */
- tmp = malloc(strlen(msginfo->folder->prefs->reply_override_from_format)+1);
+ tmp = g_malloc(strlen(msginfo->folder->prefs->reply_override_from_format)+1);
pref_get_unescaped_pref(tmp, msginfo->folder->prefs->reply_override_from_format);
#ifdef USE_ENCHANT
@@ -1729,7 +1729,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
full_msginfo = procmsg_msginfo_copy(msginfo);
/* decode \-escape sequences in the internal representation of the quote format */
- tmp = malloc(strlen(msginfo->folder->prefs->forward_override_from_format)+1);
+ tmp = g_malloc(strlen(msginfo->folder->prefs->forward_override_from_format)+1);
pref_get_unescaped_pref(tmp, msginfo->folder->prefs->forward_override_from_format);
#ifdef USE_ENCHANT
@@ -1924,7 +1924,7 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_
gchar *buf = NULL;
/* decode \-escape sequences in the internal representation of the quote format */
- tmp = malloc(strlen(msginfo->folder->prefs->forward_override_from_format)+1);
+ tmp = g_malloc(strlen(msginfo->folder->prefs->forward_override_from_format)+1);
pref_get_unescaped_pref(tmp, msginfo->folder->prefs->forward_override_from_format);
#ifdef USE_ENCHANT
@@ -2959,7 +2959,7 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
gchar *tmp = NULL;
/* decode \-escape sequences in the internal representation of the quote format */
- tmp = malloc(strlen(fmt)+1);
+ tmp = g_malloc(strlen(fmt)+1);
pref_get_unescaped_pref(tmp, fmt);
quote_fmt_scan_string(tmp);
quote_fmt_parse();
diff --git a/src/prefs_common.c b/src/prefs_common.c
@@ -1439,7 +1439,7 @@ void pref_set_textview_from_pref(GtkTextView *textview, const gchar *txt)
if (!txt) {
gtk_text_buffer_set_text(buffer, "", -1);
} else {
- out = malloc(strlen(txt)+1);
+ out = g_malloc(strlen(txt)+1);
pref_get_unescaped_pref(out, txt);
@@ -1458,7 +1458,7 @@ void pref_set_entry_from_pref(GtkEntry *entry, const gchar *txt)
if (!txt) {
gtk_entry_set_text(entry, "");
} else {
- out = malloc(strlen(txt)+1);
+ out = g_malloc(strlen(txt)+1);
pref_get_unescaped_pref(out, txt);