From f76f8c1c112c2b8262f3fbba856ca55c53054a4b Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 4 Feb 2003 20:56:50 +0000 Subject: [PATCH] 2003-02-04 Marcus Brinkmann * trustlist.c (trustlist_colon_handler): Release ITEM if name could not be allocated. (gpgme_trust_item_release): Only release name if it is allocated. Reported by Marc Mutz . --- trunk/gpgme/ChangeLog | 7 +++++++ trunk/gpgme/trustlist.c | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 3c50700..78d2b46 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,10 @@ +2003-02-04 Marcus Brinkmann + + * trustlist.c (trustlist_colon_handler): Release ITEM if name + could not be allocated. + (gpgme_trust_item_release): Only release name if it is allocated. + Reported by Marc Mutz . + 2003-02-04 Marcus Brinkmann * rungpg.c (read_status): If he status handler returns an error, diff --git a/trunk/gpgme/trustlist.c b/trunk/gpgme/trustlist.c index 8dbc9f5..0a6f635 100644 --- a/trunk/gpgme/trustlist.c +++ b/trunk/gpgme/trustlist.c @@ -120,8 +120,10 @@ trustlist_colon_handler (GpgmeCtx ctx, char *line) break; case 9: /* user ID */ item->name = strdup (p); - if (!item->name) + if (!item->name) { + gpgme_trust_item_release (item); return GPGME_Out_Of_Core; + } break; } } @@ -270,7 +272,8 @@ gpgme_trust_item_release (GpgmeTrustItem item) { if (!item) return; - free (item->name); + if (item->name) + free (item->name); free (item); } -- 2.26.2