aboutsummaryrefslogtreecommitdiffstats
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
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]>.
-rw-r--r--gpgme/ChangeLog7
-rw-r--r--gpgme/trustlist.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog
index 3c507006..78d2b460 100644
--- a/gpgme/ChangeLog
+++ b/gpgme/ChangeLog
@@ -1,5 +1,12 @@
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]>.
+
+2003-02-04 Marcus Brinkmann <[email protected]>
+
* rungpg.c (read_status): If he status handler returns an error,
return it.
(status_handler): If read_status fails, just return the error.
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);
}