From a5cfcdd2769b207283645531faba5864a7fd20e5 Mon Sep 17 00:00:00 2001 From: Omar Kilani Date: Thu, 12 Jan 2006 03:50:22 +0000 Subject: [PATCH] Don't leak a json_object on a decode error. --- ext/json/json.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/json/json.c b/ext/json/json.c index 43902a8cb5..5edacc3262 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -331,6 +331,7 @@ PHP_FUNCTION(json_decode) z = json_decode_r(jo, assoc TSRMLS_CC); if (!z) { + json_object_put(jo); RETURN_NULL(); } -- 2.50.1