2011-02-10 [pawel] 3.7.8cvs52
authorPaweł Pękala <c0rn@gazeta.pl>
Thu, 10 Feb 2011 19:34:00 +0000 (19:34 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Thu, 10 Feb 2011 19:34:00 +0000 (19:34 +0000)
* src/ldapupdate.c
Fix memleaks

ChangeLog
PATCHSETS
configure.ac
src/ldapupdate.c

index 18f6b52..c31a9d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-10 [pawel]     3.7.8cvs52
+
+       * src/ldapupdate.c
+               Fix memleaks
+
 2011-02-10 [pawel]     3.7.8cvs51
 
        * src/prefs_toolbar.c
index f9f9857..040ffff 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.105.2.162 -r 1.105.2.163 src/prefs_account.c;  ) > 3.7.8cvs49.patchset
 ( cvs diff -u -r 1.105.2.163 -r 1.105.2.164 src/prefs_account.c;  ) > 3.7.8cvs50.patchset
 ( cvs diff -u -r 1.30.2.61 -r 1.30.2.62 src/prefs_toolbar.c;  ) > 3.7.8cvs51.patchset
+( cvs diff -u -r 1.1.2.27 -r 1.1.2.28 src/ldapupdate.c;  ) > 3.7.8cvs52.patchset
index 39267b3..75b9a2c 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=51
+EXTRA_VERSION=52
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 85d06d5..6e9e1d4 100644 (file)
@@ -382,17 +382,16 @@ Rdn *ldapsvr_modify_dn(GHashTable *hash, gchar *dn) {
                return NULL;
        }
        rdn = rdn_create();
-       rdn->value = g_strdup(val);
-       rdn->attribute = g_strdup(compare);
-       g_free(val);
+       rdn->value = val;
+       rdn->attribute = compare;
+
        if (strcmp("mail", rdn->attribute) == 0) {
                GList *list = g_hash_table_lookup(hash, rdn->attribute);
                while (list) {
                        EmailKeyValue *item = list->data;
-                       compare = g_strdup((gchar *) item->mail);
+                       compare = (gchar *) item->mail;
                        if (strcmp(compare, rdn->value) == 0) {
                                update_rdn(rdn, compare, rest);
-                               g_free(compare);
                                return rdn;
                        }
                        list = g_list_next(list);
@@ -401,12 +400,10 @@ Rdn *ldapsvr_modify_dn(GHashTable *hash, gchar *dn) {
                if (strcmp(compare, rdn->attribute) != 0) {
                        /* RDN changed. Find new */
                        update_rdn(rdn, compare, rest);
-                       g_free(compare);
                        return rdn;
                }
                else {
                        /* We cannot remove dn */
-                       g_free(compare);
                        rdn_free(rdn);
                        return NULL;
                }