Fix some Leaks

This commit is contained in:
Florian Märkl 2019-08-03 21:16:14 +02:00
commit b9367ff12e
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
3 changed files with 12 additions and 1 deletions

View file

@ -29,6 +29,7 @@ ServerItemWidget::ServerItemWidget(QWidget *parent) : QWidget(parent)
auto label = new QLabel("Server", this);
layout->addWidget(label);
this->selected = true;
SetSelected(false);
setFixedSize(200, 200);

View file

@ -347,7 +347,7 @@ static void *session_thread_func(void *arg)
if(!session->audio_receiver)
{
CHIAKI_LOGE(&session->log, "Session failed to initialize Audio Receiver");
QUIT(quit_ctrl);
QUIT(quit_ecdh);
}
session->video_receiver = chiaki_video_receiver_new(session);
@ -386,6 +386,9 @@ quit_audio_receiver:
chiaki_audio_receiver_free(session->audio_receiver);
session->audio_receiver = NULL;
quit_ecdh:
chiaki_ecdh_fini(&session->ecdh);
quit_ctrl:
chiaki_ctrl_stop(&session->ctrl);
chiaki_ctrl_join(&session->ctrl);

View file

@ -667,7 +667,10 @@ static void *takion_thread_func(void *user)
break;
ChiakiErrorCode err = takion_recv(takion, buf, &received_size, UINT64_MAX);
if(err != CHIAKI_ERR_SUCCESS)
{
free(buf);
break;
}
uint8_t *resized_buf = realloc(buf, received_size);
if(!resized_buf)
{
@ -853,6 +856,7 @@ static void takion_flush_data_queue(ChiakiTakion *takion)
if(entry->payload_size < 9)
{
free(entry->packet_buf);
free(entry);
continue;
}
@ -874,6 +878,9 @@ static void takion_flush_data_queue(ChiakiTakion *takion)
event.data.buf_size = (size_t)(entry->payload_size - 9);
takion->cb(&event, takion->cb_user);
}
free(entry->packet_buf);
free(entry);
}
}