diff --git a/libretro-common/formats/png/rpng.c b/libretro-common/formats/png/rpng.c index 0bc1efca16..2624a21f6b 100644 --- a/libretro-common/formats/png/rpng.c +++ b/libretro-common/formats/png/rpng.c @@ -804,6 +804,12 @@ static struct rpng_process_t *rpng_process_init(rpng_t *rpng, return process; error: + if (process->inflate_buf) + free(process->inflate_buf); + if (process->stream) + process->stream_backend->stream_free(process->stream); + if (process) + free(process); return NULL; }