We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05f2fc5 commit b434301Copy full SHA for b434301
ext/json/json.c
@@ -375,6 +375,11 @@ PHP_FUNCTION(json_last_error_msg)
375
{
376
ZEND_PARSE_PARAMETERS_NONE();
377
378
- RETURN_STRING(php_json_get_error_msg(JSON_G(error_code)));
+ char *msg = php_json_get_error_msg(JSON_G(error_code));
379
+ RETVAL_STRING(msg);
380
+ if (JSON_G(error_code) == PHP_JSON_ERROR_SYNTAX) {
381
+ efree(msg);
382
+ }
383
+ //original:RETURN_STRING(php_json_get_error_msg(JSON_G(error_code)));
384
}
385
/* }}} */
0 commit comments