diff --git a/toxav/codec.c b/toxav/codec.c index 2b892be7..2c15cb4d 100644 --- a/toxav/codec.c +++ b/toxav/codec.c @@ -482,6 +482,7 @@ CSSession *cs_new(const ToxAvCSettings *cs_self, const ToxAvCSettings *cs_peer, if (create_recursive_mutex(cs->queue_mutex) != 0) { LOGGER_WARNING("Failed to create recursive mutex!"); + free(cs); return NULL; } @@ -673,4 +674,4 @@ void queue_message(RTPSession *session, RTPMessage *msg) end: rtp_free_msg(NULL, msg); } -} \ No newline at end of file +}