Skip to content

Commit aa8cac5

Browse files
committed
Fix double free in formatted_print.c
1 parent 559ede1 commit aa8cac5

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ PHP NEWS
2727
. Fixed bug #70987 (static::class within Closure::call() causes segfault).
2828
(Andrea)
2929
. Fixed bug #71013 (Incorrect exception handler with yield from). (Bob)
30+
. Fixed double free in error condition of format printer. (Bob)
3031

3132
- CLI server:
3233
. Fixed bug #71005 (Segfault in php_cli_server_dispatch_router()). (Adam)

ext/standard/formatted_print.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,6 @@ php_formatted_print(zend_execute_data *execute_data, int use_array, int format_o
518518
efree(newargs);
519519
}
520520
php_error_docref(NULL, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX);
521-
if (newargs) {
522-
efree(newargs);
523-
}
524521
return NULL;
525522
}
526523
adjusting |= ADJ_WIDTH;
@@ -540,9 +537,6 @@ php_formatted_print(zend_execute_data *execute_data, int use_array, int format_o
540537
efree(newargs);
541538
}
542539
php_error_docref(NULL, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX);
543-
if (newargs) {
544-
efree(newargs);
545-
}
546540
return NULL;
547541
}
548542
adjusting |= ADJ_PRECISION;

0 commit comments

Comments
 (0)