aboutsummaryrefslogtreecommitdiffstats
path: root/gpgme/trustlist.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2003-02-04 20:56:50 +0000
committerMarcus Brinkmann <[email protected]>2003-02-04 20:56:50 +0000
commitd2992c518c806c52b53f8f1d19e9d9483a2a6fa3 (patch)
treec3ea32aaed041a821d383025bdbdc6e3cd1138e9 /gpgme/trustlist.c
parent2003-02-04 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-d2992c518c806c52b53f8f1d19e9d9483a2a6fa3.tar.gz
gpgme-d2992c518c806c52b53f8f1d19e9d9483a2a6fa3.zip
2003-02-04 Marcus Brinkmann <[email protected]>
* 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 <[email protected]>.
Diffstat (limited to '')
-rw-r--r--gpgme/trustlist.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gpgme/trustlist.c b/gpgme/trustlist.c
index 8dbc9f58..0a6f635f 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);
}