mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fix memory leak in error path in group A/V.
This probably doesn't happen, but it can in theory, so we avoid it.
This commit is contained in:
parent
d518374819
commit
97a4b8e6a7
|
@ -262,7 +262,10 @@ static void group_av_peer_new(void *object, uint32_t groupnumber, uint32_t frien
|
||||||
}
|
}
|
||||||
|
|
||||||
peer_av->buffer = create_queue(GROUP_JBUF_SIZE);
|
peer_av->buffer = create_queue(GROUP_JBUF_SIZE);
|
||||||
group_peer_set_object(group_av->g_c, groupnumber, friendgroupnumber, peer_av);
|
|
||||||
|
if (group_peer_set_object(group_av->g_c, groupnumber, friendgroupnumber, peer_av) == -1) {
|
||||||
|
free(peer_av);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void group_av_peer_delete(void *object, uint32_t groupnumber, void *peer_object)
|
static void group_av_peer_delete(void *object, uint32_t groupnumber, void *peer_object)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user