summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/t_x509.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/t_x509.c')
-rw-r--r--src/lib/libcrypto/asn1/t_x509.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c
index 5de4833ed0..d1034c47f8 100644
--- a/src/lib/libcrypto/asn1/t_x509.c
+++ b/src/lib/libcrypto/asn1/t_x509.c
@@ -433,15 +433,17 @@ err:
433 433
434int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) 434int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
435 { 435 {
436 char *s,*c; 436 char *s,*c,*b;
437 int ret=0,l,ll,i,first=1; 437 int ret=0,l,ll,i,first=1;
438 char buf[256];
439 438
440 ll=80-2-obase; 439 ll=80-2-obase;
441 440
442 s=X509_NAME_oneline(name,buf,256); 441 b=s=X509_NAME_oneline(name,NULL,0);
443 if (!*s) 442 if (!*s)
443 {
444 OPENSSL_free(b);
444 return 1; 445 return 1;
446 }
445 s++; /* skip the first slash */ 447 s++; /* skip the first slash */
446 448
447 l=ll; 449 l=ll;
@@ -497,6 +499,7 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
497err: 499err:
498 X509err(X509_F_X509_NAME_PRINT,ERR_R_BUF_LIB); 500 X509err(X509_F_X509_NAME_PRINT,ERR_R_BUF_LIB);
499 } 501 }
502 OPENSSL_free(b);
500 return(ret); 503 return(ret);
501 } 504 }
502 505