From 2b3120c113e88cfcd18b68e78eef6b24df37e119 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Wed, 6 Jun 2007 08:35:09 +0000 Subject: [PATCH] 2007-06-06 [colin] 2.9.2cvs44 * src/ldapupdate.c Fix strange allocations. --- ChangeLog | 5 +++++ PATCHSETS | 1 + configure.ac | 2 +- src/ldapupdate.c | 6 ++---- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ee2eae91..0e10b25ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-06 [colin] 2.9.2cvs44 + + * src/ldapupdate.c + Fix strange allocations. + 2007-06-06 [colin] 2.9.2cvs43 * src/ldapupdate.c diff --git a/PATCHSETS b/PATCHSETS index 6e183d2b7..d75543712 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2619,3 +2619,4 @@ ( cvs diff -u -r 1.149.2.73 -r 1.149.2.74 src/inc.c; ) > 2.9.2cvs41.patchset ( cvs diff -u -r 1.105.2.100 -r 1.105.2.101 src/prefs_account.c; cvs diff -u -r 1.52.2.39 -r 1.52.2.40 src/prefs_folder_item.c; cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/prefs_quote.c; cvs diff -u -r 1.8.2.18 -r 1.8.2.19 src/quote_fmt.c; cvs diff -u -r 1.5.12.10 -r 1.5.12.11 src/quote_fmt.h; ) > 2.9.2cvs42.patchset ( cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/ldapupdate.c; ) > 2.9.2cvs43.patchset +( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/ldapupdate.c; ) > 2.9.2cvs44.patchset diff --git a/configure.ac b/configure.ac index 895521c86..70dca1123 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=2 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=43 +EXTRA_VERSION=44 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/ldapupdate.c b/src/ldapupdate.c index 3bf5ac1af..eca943eb2 100644 --- a/src/ldapupdate.c +++ b/src/ldapupdate.c @@ -714,8 +714,7 @@ void ldapsvr_add_contact(LdapServer *server, GHashTable *contact) { mailList = g_hash_table_lookup(contact , "mail"); if (mailList) { char **tmp; - mail = g_malloc(sizeof(*mail)); - tmp = g_malloc(sizeof(*tmp)); + tmp = g_malloc(sizeof(*tmp) * (g_list_length(mailList)+1)); mail = tmp; while (mailList) { EmailKeyValue *item = mailList->data; @@ -930,8 +929,7 @@ void ldapsvr_update_contact(LdapServer *server, GHashTable *contact) { debug_print("# of mail: %d\n", g_list_length(mailList)); if (!(strcmp("mail", NoRemove->attribute) == 0 && g_list_length(mailList) == 1)) { char **tmp; - mail = g_malloc(sizeof(*mail)); - tmp = g_malloc(sizeof(*tmp)); + tmp = g_malloc(sizeof(*tmp) * (g_list_length(mailList)+1)); mail = tmp; while (mailList) { EmailKeyValue *item = mailList->data; -- 2.25.1