diff options
author | Mattias Andrée <maandree@kth.se> | 2021-04-02 22:47:53 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-04-02 22:47:53 +0200 |
commit | d161aa539a449cc6fa66fb73ad54f997bcd49b13 (patch) | |
tree | e59a18a53191c148fc372a7cbbc82cd000bbfadc /libcontacts_contact_destroy.c | |
parent | Add full name, use separate fields for birthday componets and add when leapies celebrate on common years (diff) | |
download | libcontacts-d161aa539a449cc6fa66fb73ad54f997bcd49b13.tar.gz libcontacts-d161aa539a449cc6fa66fb73ad54f997bcd49b13.tar.bz2 libcontacts-d161aa539a449cc6fa66fb73ad54f997bcd49b13.tar.xz |
Fix parsing and memory leaks
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libcontacts_contact_destroy.c')
-rw-r--r-- | libcontacts_contact_destroy.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/libcontacts_contact_destroy.c b/libcontacts_contact_destroy.c index 70d1335..6ea1825 100644 --- a/libcontacts_contact_destroy.c +++ b/libcontacts_contact_destroy.c @@ -11,17 +11,20 @@ libcontacts_contact_destroy(struct libcontacts_contact *this) free(this->last_name); free(this->full_name); free(this->nickname); - DESTROY_ALL(this->photos, free); - DESTROY_ALL(this->groups, free); + DESTROY_ALL_STRINGS(this->photos); + DESTROY_ALL_STRINGS(this->groups); free(this->notes); - DESTROY_ALL(this->blocks, libcontacts_block_destroy); - DESTROY_ALL(this->organisations, libcontacts_organisation_destroy); - DESTROY_ALL(this->emails, libcontacts_email_destroy); - DESTROY_ALL(this->pgpkeys, libcontacts_pgpkey_destroy); - DESTROY_ALL(this->numbers, libcontacts_number_destroy); - DESTROY_ALL(this->addresses, libcontacts_address_destroy); - DESTROY_ALL(this->sites, libcontacts_site_destroy); - DESTROY_ALL(this->chats, libcontacts_chat_destroy); - libcontacts_birthday_destroy(this->birthday); - DESTROY_ALL(this->unrecognised_data, free); + DESTROY_ALL_OBJECTS(this->blocks, libcontacts_block_destroy); + DESTROY_ALL_OBJECTS(this->organisations, libcontacts_organisation_destroy); + DESTROY_ALL_OBJECTS(this->emails, libcontacts_email_destroy); + DESTROY_ALL_OBJECTS(this->pgpkeys, libcontacts_pgpkey_destroy); + DESTROY_ALL_OBJECTS(this->numbers, libcontacts_number_destroy); + DESTROY_ALL_OBJECTS(this->addresses, libcontacts_address_destroy); + DESTROY_ALL_OBJECTS(this->sites, libcontacts_site_destroy); + DESTROY_ALL_OBJECTS(this->chats, libcontacts_chat_destroy); + if (this->birthday) { + libcontacts_birthday_destroy(this->birthday); + free(this->birthday); + } + DESTROY_ALL_STRINGS(this->unrecognised_data); } |