From 6318e1102743807ff2fd6ea69d5376c9353a4645 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 29 Jun 2020 20:02:28 +0200 Subject: [PATCH] Try to prevent static code analyzer warning about potential leak --- libretro-common/streams/file_stream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index d84c6d736e..82ae03db65 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -111,7 +111,11 @@ bool filestream_exists(const char *path) if (!dummy) return false; - filestream_close(dummy); + if (filestream_close(dummy) != 0) + if (dummy) + free(dummy); + + dummy = NULL; return true; }