fixed leak
authorColin Leroy <colin@colino.net>
Mon, 11 Nov 2002 21:31:23 +0000 (21:31 +0000)
committerColin Leroy <colin@colino.net>
Mon, 11 Nov 2002 21:31:23 +0000 (21:31 +0000)
ChangeLog.claws
configure.in
src/ssl_certificate.c

index 2c4251b..f7decf0 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-11 [colin]     0.8.5claws125
+       
+       * src/ssl_certificate.c
+               Fixed leak
+
 2002-11-11 [colin]     0.8.5claws124
 
        * src/ssl.c
index f4c22c3..c0aec89 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws124
+EXTRA_VERSION=claws125
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 0b869b9..6632d3a 100644 (file)
@@ -97,18 +97,24 @@ static void ssl_certificate_save (SSLCertificate *cert)
 
 static char* ssl_certificate_to_string(SSLCertificate *cert)
 {
-       char *ret;
+       char *ret, *issuer, *subject, *fingerprint;
        int j;
        unsigned int n;
        unsigned char md[EVP_MAX_MD_SIZE];      
                
        X509_digest(cert->x509_cert, EVP_md5(), md, &n);
-                       
+       issuer = X509_NAME_oneline(X509_get_issuer_name(cert->x509_cert), 0, 0);
+       subject = X509_NAME_oneline(X509_get_subject_name(cert->x509_cert), 0, 0);
+       fingerprint = readable_fingerprint(md, (int)n);         
        ret = g_strdup_printf("  Issuer: %s\n  Subject: %s\n  Fingerprint: %s",
-                               X509_NAME_oneline(X509_get_issuer_name(cert->x509_cert), 0, 0),
-                               X509_NAME_oneline(X509_get_subject_name(cert->x509_cert), 0, 0),
-                               readable_fingerprint(md, (int)n));
+                               issuer, subject, fingerprint);
 
+       if (issuer)
+               g_free(issuer);
+       if (subject)
+               g_free(subject);
+       if (fingerprint)
+               g_free(fingerprint);
        return ret;
 }