Try to not leak memory.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18797 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -853,6 +853,7 @@ request_create(struct request_create_options *opt, int argc, char **argv)
|
|||||||
ret = _hx509_request_set_SubjectPublicKeyInfo(context,
|
ret = _hx509_request_set_SubjectPublicKeyInfo(context,
|
||||||
req,
|
req,
|
||||||
&key);
|
&key);
|
||||||
|
free_SubjectPublicKeyInfo(&key);
|
||||||
if (ret)
|
if (ret)
|
||||||
errx(1, "_hx509_request_set_SubjectPublicKeyInfo: %d", ret);
|
errx(1, "_hx509_request_set_SubjectPublicKeyInfo: %d", ret);
|
||||||
|
|
||||||
|
@@ -59,7 +59,13 @@ _hx509_request_init(hx509_context context, hx509_request *req)
|
|||||||
void
|
void
|
||||||
_hx509_request_free(hx509_request *req)
|
_hx509_request_free(hx509_request *req)
|
||||||
{
|
{
|
||||||
|
if ((*req)->name)
|
||||||
|
hx509_name_free(&(*req)->name);
|
||||||
|
free_SubjectPublicKeyInfo(&(*req)->key);
|
||||||
|
free_ExtKeyUsage(&(*req)->eku);
|
||||||
|
free_GeneralNames(&(*req)->san);
|
||||||
free(*req);
|
free(*req);
|
||||||
|
memset(*req, 0, sizeof(**req));
|
||||||
*req = NULL;
|
*req = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user