From d9ee3fd2939632a9e81086bfe373cdbf2dbbc776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sat, 21 Oct 2006 18:24:15 +0000 Subject: [PATCH] (der_parse_heim_oid): avoid leaking memory git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18767 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/asn1/der_format.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/asn1/der_format.c b/lib/asn1/der_format.c index fc3593456..8e3319ebc 100644 --- a/lib/asn1/der_format.c +++ b/lib/asn1/der_format.c @@ -149,6 +149,7 @@ der_parse_heim_oid (const char *str, const char *sep, heim_oid *data) (data->length + 1) * sizeof(data->components[0])); if (c == NULL) { der_free_oid(data); + free(s); return ENOMEM; } data->components = c; @@ -156,9 +157,11 @@ der_parse_heim_oid (const char *str, const char *sep, heim_oid *data) l = strtol(w, &endptr, 10); if (*endptr != '\0' || l < 0 || l > INT_MAX) { der_free_oid(data); + free(s); return EINVAL; } data->components[data->length++] = l; } + free(s); return 0; }