mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-06 18:41:30 +00:00
api_lib.c: somes resources couldn't be freed if there was errors during netconn_new_with_proto_and_callback.
This commit is contained in:
parent
5fff6e7ff8
commit
db739d16ce
@ -71,6 +71,10 @@ HISTORY
|
|||||||
|
|
||||||
++ Bug fixes:
|
++ Bug fixes:
|
||||||
|
|
||||||
|
2007-03-22 Frédéric Bernon
|
||||||
|
* api_lib.c: somes resources couldn't be freed if there was errors during
|
||||||
|
netconn_new_with_proto_and_callback.
|
||||||
|
|
||||||
2007-03-22 Frédéric Bernon
|
2007-03-22 Frédéric Bernon
|
||||||
* ethernetif.c: update netif->input calls to check return value. In older ports,
|
* ethernetif.c: update netif->input calls to check return value. In older ports,
|
||||||
it's a good idea to upgrade them, even if before, there could be another problem
|
it's a good idea to upgrade them, even if before, there could be another problem
|
||||||
|
@ -221,6 +221,7 @@ netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u16_t proto,
|
|||||||
conn->acceptmbox = SYS_MBOX_NULL;
|
conn->acceptmbox = SYS_MBOX_NULL;
|
||||||
conn->sem = sys_sem_new(0);
|
conn->sem = sys_sem_new(0);
|
||||||
if (conn->sem == SYS_SEM_NULL) {
|
if (conn->sem == SYS_SEM_NULL) {
|
||||||
|
sys_mbox_free(conn->mbox);
|
||||||
memp_free(MEMP_NETCONN, conn);
|
memp_free(MEMP_NETCONN, conn);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -238,6 +239,8 @@ netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u16_t proto,
|
|||||||
api_msg_post(&msg);
|
api_msg_post(&msg);
|
||||||
|
|
||||||
if ( conn->err != ERR_OK ) {
|
if ( conn->err != ERR_OK ) {
|
||||||
|
sys_sem_free(conn->sem);
|
||||||
|
sys_mbox_free(conn->mbox);
|
||||||
memp_free(MEMP_NETCONN, conn);
|
memp_free(MEMP_NETCONN, conn);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user