aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@src.gnome.org>2000-03-29 10:20:18 +0800
committerChris Toshok <toshok@src.gnome.org>2000-03-29 10:20:18 +0800
commitc169edca762daf6d56dd1b48d738b9c37f0b5028 (patch)
treeb9e0cf727cd45cb263ee0ea1fa024c300e1969a7
parent468049294f22d48ab9b43e9e5d88f5457bb04002 (diff)
downloadgsoc2013-evolution-c169edca762daf6d56dd1b48d738b9c37f0b5028.tar
gsoc2013-evolution-c169edca762daf6d56dd1b48d738b9c37f0b5028.tar.gz
gsoc2013-evolution-c169edca762daf6d56dd1b48d738b9c37f0b5028.tar.bz2
gsoc2013-evolution-c169edca762daf6d56dd1b48d738b9c37f0b5028.tar.lz
gsoc2013-evolution-c169edca762daf6d56dd1b48d738b9c37f0b5028.tar.xz
gsoc2013-evolution-c169edca762daf6d56dd1b48d738b9c37f0b5028.tar.zst
gsoc2013-evolution-c169edca762daf6d56dd1b48d738b9c37f0b5028.zip
remove unnecessary strdup/free.
* addressbook/backend/pas/pas-backend-file.c (pas_backend_file_build_all_cards_list): remove unnecessary strdup/free. svn path=/trunk/; revision=2240
-rw-r--r--ChangeLog6
-rw-r--r--addressbook/backend/pas/pas-backend-file.c16
2 files changed, 12 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 3811bcaa66..c702f41d31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-03-28 Chris Toshok <toshok@laptoph.xtoph.org>
+
+ * addressbook/backend/pas/pas-backend-file.c
+ (pas_backend_file_build_all_cards_list): remove unnecessary
+ strdup/free.
+
2000-03-28 Christopher James Lahey <clahey@helixcode.com>
* addressbook/backend/pas/pas-backend-file.c: Removed an infinite
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index 5c108f740a..3dd0ced33a 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -221,7 +221,6 @@ pas_backend_file_build_all_cards_list(PASBackend *backend,
DB *db = bf->priv->file_db;
int db_error;
DBT id_dbt, vcard_dbt;
- char *id;
cursor_data->elements = NULL;
@@ -229,16 +228,13 @@ pas_backend_file_build_all_cards_list(PASBackend *backend,
while (db_error == 0) {
- id = g_strndup(id_dbt.data, id_dbt.size);
-
/* don't include the version in the list of cards */
- if (!strcmp (id, PAS_BACKEND_FILE_VERSION_NAME)) {
- g_free(id);
- }
- else {
- g_free(id);
- cursor_data->elements = g_list_append(cursor_data->elements, g_strndup(vcard_dbt.data,
- vcard_dbt.size));
+ if (id_dbt.size != strlen(PAS_BACKEND_FILE_VERSION_NAME)
+ || strncmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME, id_dbt.size)) {
+
+ cursor_data->elements = g_list_append(cursor_data->elements,
+ g_strndup(vcard_dbt.data,
+ vcard_dbt.size));
}
db_error = db->seq(db, &id_dbt, &vcard_dbt, R_NEXT);