diff options
author | Andre Heinecke <[email protected]> | 2017-02-01 17:03:35 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2017-02-01 17:06:22 +0000 |
commit | b5075030bec9b21bf4e515bc1686df3fa43eced2 (patch) | |
tree | d8f37fd1e593fc875e720a6fbcf844bd10af69f2 /src/key.c | |
parent | core: Improve mailbox only uid handling (diff) | |
download | gpgme-b5075030bec9b21bf4e515bc1686df3fa43eced2.tar.gz gpgme-b5075030bec9b21bf4e515bc1686df3fa43eced2.zip |
core: Fix leakage of address for mail only uids
* src/key.c (gpgme_key_unref): Always free address if set.
(_gpgme_key_append_name): Remove memory optimization for address.
--
The check if address is not allocated would now be more complicated
then just comparing it to email because email is set to address
also when an email was not parsed from the user id.
Diffstat (limited to 'src/key.c')
-rw-r--r-- | src/key.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -236,12 +236,6 @@ _gpgme_key_append_name (gpgme_key_t key, const char *src, int convert) &uid->comment, dst); uid->address = _gpgme_mailbox_from_userid (uid->uid); - if (uid->address && uid->email && !strcmp (uid->address, uid->email)) - { - /* The ADDRESS is the same as EMAIL: Save some space. */ - free (uid->address); - uid->address = uid->email; - } if ((!uid->email || !*uid->email) && uid->address && uid->name && !strcmp (uid->name, uid->address)) { @@ -394,9 +388,7 @@ gpgme_key_unref (gpgme_key_t key) tofu = tofu_next; } - if (uid->address && uid->address != uid->email) - free (uid->address); - + free (uid->address); free (uid); uid = next_uid; } |