Blob Blame History Raw
From 4751b606fa38edc456d627140898a7ec679fcc24 Mon Sep 17 00:00:00 2001
From: Vladimir Mitrovic <vladimir.x.mitrovic@gmail.com>
Date: Wed, 5 Aug 2015 03:01:06 +0200
Subject: [PATCH] gdImageScaleTwoPass memory leak fix

Fixing memory leak in gdImageScaleTwoPass, as reported by @cmb69 and
confirmed by @vapier.  This bug actually bit me in production and I'm
very thankful that it was reported with an easy fix.

Fixes #173.
---
 src/gd_interpolation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gd_interpolation.c b/src/gd_interpolation.c
index fcc11e6..f00c946 100644
--- a/src/gd_interpolation.c
+++ b/src/gd_interpolation.c
@@ -1087,7 +1087,7 @@ gdImageScaleTwoPass(const gdImagePtr src, const unsigned int new_width,
     }/* if */
 
     if (src != tmp_im) {
-        gdFree(tmp_im);
+        gdImageDestroy(tmp_im);
     }/* if */
 
 	return dst;