+2011-11-20 [mir] 0.6.0cvs24
+
+ * plugins/ldap/ldap-plugin.c
+ Forgot to free LDAPMessage in case of en error.
+ More clever handling of AbookConnection structure
+ when writing new configuration.
+
2011-11-20 [mir] 0.6.0cvs23
* src/callbacks.c
( cvs diff -u -r 1.4 -r 1.5 plugins/ldap/ldap-plugin.c; ) > 0.6.0cvs21.patchset
( cvs diff -u -r 1.5 -r 1.6 plugins/example/example-plugin.c; cvs diff -u -r 1.5 -r 1.6 plugins/ldap/ldap-plugin.c; cvs diff -u -r 1.6 -r 1.7 plugins/xml/xml-plugin.c; cvs diff -u -r 1.6 -r 1.7 src/callbacks.c; cvs diff -u -r 1.1 -r 1.2 src/callbacks.h; cvs diff -u -r 1.4 -r 1.5 src/contactwindow.c; cvs diff -u -r 1.1 -r 1.2 src/mainwindow.h; cvs diff -u -r 1.7 -r 1.8 src/plugin-loader.c; cvs diff -u -r 1.5 -r 1.6 src/plugin-loader.h; cvs diff -u -r 1.6 -r 1.7 src/plugin.h; cvs diff -u -r 1.5 -r 1.6 src/utils.c; cvs diff -u -r 1.5 -r 1.6 src/utils.h; ) > 0.6.0cvs22.patchset
( cvs diff -u -r 1.7 -r 1.8 src/callbacks.c; ) > 0.6.0cvs23.patchset
+( cvs diff -u -r 1.6 -r 1.7 plugins/ldap/ldap-plugin.c; ) > 0.6.0cvs24.patchset
0, NULL, NULL, &timeOut, max_size, &res);
if (rc == LDAP_SUCCESS || rc == LDAP_TIMELIMIT_EXCEEDED || LDAP_SIZELIMIT_EXCEEDED)
response = g_slist_append(response, res);
+ else
+ ldap_msgfree(res);
}
else {
for (cur = server->baseDN; cur; cur = g_slist_next(cur)) {
if (rc == LDAP_SUCCESS || rc == LDAP_TIMELIMIT_EXCEEDED || LDAP_SIZELIMIT_EXCEEDED) {
response = g_slist_append(response, res);
}
+ else
+ ldap_msgfree(res);
}
}
AddressBook* new,
gchar** error) {
AddressBook* abook;
- AbookConnection* ac;
+ AbookConnection* ac = NULL;
GSList* cur;
if (! config) {
return TRUE;
}
- ac = abook_connection_new();
if (new) {
/* Update config for existing address book */
self->abook_delete(old, error);
*error = NULL;
}
abook = new;
+ ac = get_abook_connection(abook);
}
else {
/* Write config for new address book */
if (error) {
*error = g_strdup(_("Missing name for address book"));
}
- abook_connection_free(ac);
- ac = NULL;
return FALSE;
}
-
+
+ if (! ac) {
+ ac = abook_connection_new();
+ abook_connection = g_slist_prepend(abook_connection, ac);
+ }
+
+ gchar* plain = g_strconcat(abook->abook_name, abook->URL, NULL);
+ gchar* id = sha256(plain);
+ g_free(plain);
+ ac->id = g_strdup(id);
+ g_free(id);
+
g_key_file_set_string(config->key_file, abook->abook_name, "url", abook->URL);
g_key_file_set_string(config->key_file, abook->abook_name, "username", abook->username);
g_key_file_set_string(config->key_file, abook->abook_name,
}
}
}
-
- abook->dirty = TRUE;
- gchar* plain = g_strconcat(abook->abook_name, abook->URL, NULL);
- gchar* id = sha256(plain);
- g_free(plain);
- if (ac->id)
- g_free(ac->id);
- ac->id = g_strdup(id);
- g_free(id);
+ abook->dirty = TRUE;
return (*error) ? TRUE : FALSE;
}