[git] GPGME - branch, master, updated. gpgme-1.8.0-45-g8ede867
by Andre Heinecke
cvs at cvs.gnupg.org
Wed Feb 1 18:07:36 CET 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".
The branch, master has been updated
via 8ede86795a1d419c01b4910ec2fd1fb18b629452 (commit)
via b5075030bec9b21bf4e515bc1686df3fa43eced2 (commit)
from a28d31fdb623f2ee30e8094d09f1a0d1ae446a9b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8ede86795a1d419c01b4910ec2fd1fb18b629452
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Wed Feb 1 18:06:54 2017 +0100
core: Cleanup gpgme_key_unref frees
* src/key.c (gpgme_key_unref): Nowadays we assume free(NULL) is ok.
diff --git a/src/key.c b/src/key.c
index e33abd0..e2e30db 100644
--- a/src/key.c
+++ b/src/key.c
@@ -341,14 +341,10 @@ gpgme_key_unref (gpgme_key_t key)
while (subkey)
{
gpgme_subkey_t next = subkey->next;
- if (subkey->fpr)
- free (subkey->fpr);
- if (subkey->curve)
- free (subkey->curve);
- if (subkey->keygrip)
- free (subkey->keygrip);
- if (subkey->card_number)
- free (subkey->card_number);
+ free (subkey->fpr);
+ free (subkey->curve);
+ free (subkey->keygrip);
+ free (subkey->card_number);
free (subkey);
subkey = next;
}
@@ -393,15 +389,10 @@ gpgme_key_unref (gpgme_key_t key)
uid = next_uid;
}
- if (key->issuer_serial)
- free (key->issuer_serial);
- if (key->issuer_name)
- free (key->issuer_name);
-
- if (key->chain_id)
- free (key->chain_id);
- if (key->fpr)
- free (key->fpr);
+ free (key->issuer_serial);
+ free (key->issuer_name);
+ free (key->chain_id);
+ free (key->fpr);
free (key);
}
commit b5075030bec9b21bf4e515bc1686df3fa43eced2
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Wed Feb 1 18:03:35 2017 +0100
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.
diff --git a/src/key.c b/src/key.c
index fed020e..e33abd0 100644
--- a/src/key.c
+++ b/src/key.c
@@ -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;
}
-----------------------------------------------------------------------
Summary of changes:
src/key.c | 35 +++++++++--------------------------
1 file changed, 9 insertions(+), 26 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list