aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-12-07 01:24:39 +0100
committerStapleButter <thetotalworm@gmail.com>2017-12-07 01:24:39 +0100
commitb58a5334fae12f28ac3e226114da5fd8ee640d31 (patch)
tree1cfb0b7011acd26e3939c2c4c516c08befe9b65f
parenta7c777991796c1fea066a3d8d6127dbe4895a058 (diff)
fix potential memleak
-rw-r--r--src/melon_fopen.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/melon_fopen.h b/src/melon_fopen.h
index 603e15f..8e79e8b 100644
--- a/src/melon_fopen.h
+++ b/src/melon_fopen.h
@@ -29,7 +29,7 @@ static FILE* melon_fopen(const char* path, const char* mode)
if (len < 1) return NULL;
WCHAR* fatass = new WCHAR[len];
int res = MultiByteToWideChar(CP_UTF8, 0, path, -1, fatass, len);
- if (res != len) return NULL; // checkme?
+ if (res != len) { delete[] fatass; return NULL; } // checkme?
// this will be more than enough
WCHAR fatmode[4];