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