From 5b18a540d6e18d580b86edc79cfe373d26169061 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Wed, 29 Jun 2011 12:49:56 +0000 Subject: [PATCH] Proper memory cleanups (#83773) --- org.gridsite.core/src/grst_x509.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.gridsite.core/src/grst_x509.c b/org.gridsite.core/src/grst_x509.c index 9605753..f34f815 100644 --- a/org.gridsite.core/src/grst_x509.c +++ b/org.gridsite.core/src/grst_x509.c @@ -1909,13 +1909,16 @@ int GRSTx509MakeProxyCert(char **proxychain, FILE *debugfp, kyu_ex = X509_EXTENSION_new(); X509_EXTENSION_set_object(kyu_ex, kyu_obj); + ASN1_OBJECT_free(kyu_obj); X509_EXTENSION_set_critical(kyu_ex, 1); kyu_oct = ASN1_OCTET_STRING_new(); ASN1_OCTET_STRING_set(kyu_oct, kyu_str, strlen(kyu_str)); X509_EXTENSION_set_data(kyu_ex, kyu_oct); + ASN1_OCTET_STRING_free(kyu_oct); X509_add_ext(certs[0], kyu_ex, -1); + X509_EXTENSION_free(kyu_ex); /* proxy certificate info */ pci_ex = X509_EXTENSION_new(); @@ -1926,10 +1929,12 @@ int GRSTx509MakeProxyCert(char **proxychain, FILE *debugfp, pci_oct = ASN1_OCTET_STRING_new(); ASN1_OCTET_STRING_set(pci_oct, pci_str, strlen(pci_str)); X509_EXTENSION_set_data(pci_ex, pci_oct); + ASN1_OCTET_STRING_free(pci_oct); X509_add_ext(certs[0], pci_ex, -1); + X509_EXTENSION_free(pci_ex); } - else ASN1_OBJECT_free(pci_obj); + ASN1_OBJECT_free(pci_obj); /* set issuer and subject name of the cert from the req and the CA */ -- 1.8.2.3