From: Marcus Brinkmann Date: Tue, 4 Feb 2003 20:56:50 +0000 (+0000) Subject: 2003-02-04 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~696 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f76f8c1c112c2b8262f3fbba856ca55c53054a4b;p=gpgme.git 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 . --- 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); }