mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
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.
This commit is contained in:
parent
af1a75d2c9
commit
9bf3ba28e1
@ -2027,8 +2027,10 @@ smp_fetch_ssl_c_sig_alg(struct proxy *px, struct session *l4, void *l7, unsigned
|
||||
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 @@ smp_fetch_ssl_c_key_alg(struct proxy *px, struct session *l4, void *l7, unsigned
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user