mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 00:14:02 +00:00
Fix double-free when closing mbedTLS connections
Partly revert commit 0486100a2b
from 07.08.2017 as it breaks layering: every layer must free its own altcp_pcb. Freeing the inner_conn is not the right way.
This commit is contained in:
parent
6ef5f68c72
commit
bd2e820829
@ -563,6 +563,8 @@ altcp_mbedtls_setup(void *conf, struct altcp_pcb *conn, struct altcp_pcb *inner_
|
||||
if (!conf) {
|
||||
return ERR_ARG;
|
||||
}
|
||||
LWIP_ASSERT("invalid inner_conn", conn != inner_conn);
|
||||
|
||||
/* allocate mbedtls context */
|
||||
state = altcp_mbedtls_alloc(conf);
|
||||
if (state == NULL) {
|
||||
@ -970,10 +972,6 @@ altcp_mbedtls_dealloc(struct altcp_pcb *conn)
|
||||
altcp_mbedtls_free(state->conf, state);
|
||||
conn->state = NULL;
|
||||
}
|
||||
if (conn->inner_conn) {
|
||||
altcp_free(conn->inner_conn);
|
||||
conn->inner_conn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user