shithub: cstory

Download patch

ref: cccef2b089c0791f423a2f0df2fca8f4fb988a09
parent: 5e60c15b1dc1b4e08d86f1d28f57fab1e990757e
author: Clownacy <[email protected]>
date: Sun Jan 26 18:54:20 EST 2020

Fix memory leaks

--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -294,6 +294,8 @@
 	int width, height;
 	unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);
 
+	free(data);
+
 	if (image_buffer == NULL)
 	{
 		PrintBitmapError(path, 1);
@@ -387,6 +389,8 @@
 
 	int width, height;
 	unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);
+
+	free(data);
 
 	if (image_buffer == NULL)
 	{