mirror of
https://github.com/openssl/openssl.git
synced 2026-01-18 17:11:31 +01:00
bss_acpt.c: Free strings returned from previous BIO_ADDR_hostname_string() calls
CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/29452)
This commit is contained in:
@@ -266,6 +266,9 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)
|
||||
}
|
||||
}
|
||||
|
||||
/* Free old values before assigning new ones to prevent memory leak */
|
||||
OPENSSL_free(c->cache_accepting_name);
|
||||
OPENSSL_free(c->cache_accepting_serv);
|
||||
c->cache_accepting_name = BIO_ADDR_hostname_string(&c->cache_accepting_addr, 1);
|
||||
c->cache_accepting_serv = BIO_ADDR_service_string(&c->cache_accepting_addr, 1);
|
||||
c->state = ACPT_S_ACCEPT;
|
||||
|
||||
Reference in New Issue
Block a user