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:
iphydf 2018-08-12 21:34:31 +00:00
parent d518374819
commit 97a4b8e6a7
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -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);
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)