2007-06-06 [colin] 2.9.2cvs44
authorColin Leroy <colin@colino.net>
Wed, 6 Jun 2007 08:35:09 +0000 (08:35 +0000)
committerColin Leroy <colin@colino.net>
Wed, 6 Jun 2007 08:35:09 +0000 (08:35 +0000)
* src/ldapupdate.c
Fix strange allocations.

ChangeLog
PATCHSETS
configure.ac
src/ldapupdate.c

index 8ee2eae915dc0b680b1cf04f07083157c321e4e7..0e10b25ec95fdf34e00c9f1f605f2d28e0b5d77e 100644 (file)
--- 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
index 6e183d2b78d47feb7e36bcec320b02700086a9d4..d7554371217941dd72e8d3e0036efeac35a47a14 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index 895521c86282b25f79f7159e9148ea1f361f1c11..70dca11237fccbaeae25d4cf660aeb2b5ba584d5 100644 (file)
@@ -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=
 
index 3bf5ac1afa80503a27ff6d736bb4c2c38198bc05..eca943eb2722759a76641ef22e1ce24a24f7e7d8 100644 (file)
@@ -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;