mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Return values checking for tox_array_push_ptr in Lossless UDP.
This commit is contained in:
parent
ba5bd35a12
commit
f124cfaf46
|
@ -106,7 +106,9 @@ int new_connection(Lossless_UDP *ludp, IP_Port ip_port)
|
|||
}
|
||||
|
||||
if (connection_id == -1) {
|
||||
tox_array_push_ptr(&ludp->connections, 0); /* TODO: check return value */
|
||||
if (tox_array_push_ptr(&ludp->connections, 0) == 0)
|
||||
return -1;
|
||||
|
||||
connection_id = ludp->connections.len - 1;
|
||||
}
|
||||
|
||||
|
@ -156,7 +158,9 @@ static int new_inconnection(Lossless_UDP *ludp, IP_Port ip_port)
|
|||
}
|
||||
|
||||
if (connection_id == -1) {
|
||||
tox_array_push_ptr(&ludp->connections, 0); /* TODO: check return value */
|
||||
if (tox_array_push_ptr(&ludp->connections, 0) == 0)
|
||||
return -1;
|
||||
|
||||
connection_id = ludp->connections.len - 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user