BUG/MINOR: ssl: potential memory leaks using ssl_c_key_alg or ssl_c_sig_alg.
The leak occurs in an error case which practically never happens.
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 105aa1d..e79190a 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -2027,8 +2027,10 @@
nid = OBJ_obj2nid((ASN1_OBJECT *)(crt->cert_info->signature->algorithm));
smp->data.str.str = (char *)OBJ_nid2sn(nid);
- if (!smp->data.str.str)
+ if (!smp->data.str.str) {
+ X509_free(crt);
return 0;
+ }
smp->type = SMP_T_CSTR;
smp->data.str.len = strlen(smp->data.str.str);
@@ -2061,8 +2063,10 @@
nid = OBJ_obj2nid((ASN1_OBJECT *)(crt->cert_info->key->algor->algorithm));
smp->data.str.str = (char *)OBJ_nid2sn(nid);
- if (!smp->data.str.str)
+ if (!smp->data.str.str) {
+ X509_free(crt);
return 0;
+ }
smp->type = SMP_T_CSTR;
smp->data.str.len = strlen(smp->data.str.str);