From d2992c518c806c52b53f8f1d19e9d9483a2a6fa3 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 . --- gpgme/ChangeLog | 7 +++++++ gpgme/trustlist.c | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 3c50700..78d2b46 100644 --- a/gpgme/ChangeLog +++ b/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/gpgme/trustlist.c b/gpgme/trustlist.c index 8dbc9f5..0a6f635 100644 --- a/gpgme/trustlist.c +++ b/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