]> granicus.if.org Git - php/commitdiff
Don't leak a json_object on a decode error.
authorOmar Kilani <omar@php.net>
Thu, 12 Jan 2006 03:50:22 +0000 (03:50 +0000)
committerOmar Kilani <omar@php.net>
Thu, 12 Jan 2006 03:50:22 +0000 (03:50 +0000)
ext/json/json.c

index 43902a8cb522d45d9836fc738fe206263030a523..5edacc32624ea238f9601da22f80ddf0f07da9a3 100644 (file)
@@ -331,6 +331,7 @@ PHP_FUNCTION(json_decode)
 
     z = json_decode_r(jo, assoc TSRMLS_CC);
     if (!z) {
+       json_object_put(jo);
         RETURN_NULL();
     }