From b86a3f295a55dcd16e5b6911558d0a429c0cfd87 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Wed, 29 Jun 2022 15:59:56 +0000 Subject: [PATCH] Free av_frames when done with them --- src/vnc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vnc.c b/src/vnc.c index b4f9b29..71259a8 100644 --- a/src/vnc.c +++ b/src/vnc.c @@ -88,6 +88,7 @@ static void vnc_client_clear_av_frames(struct vnc_client* self) { for (int i = 0; i < self->n_av_frames; ++i) { av_frame_unref(self->av_frames[i]->frame); + av_frame_free(&self->av_frames[i]->frame); free(self->av_frames[i]); } self->n_av_frames = 0; @@ -141,6 +142,7 @@ static rfbBool vnc_client_handle_open_h264_rect(rfbClient* client, struct vnc_av_frame* f = calloc(1, sizeof(*f)); if (!f) { av_frame_unref(frame); + av_frame_free(&frame); return false; }