Skip to content

Commit 66d5cf8

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix memory leak on error return of collation callback in pdo_sqlite
2 parents 2d3ac4e + ce7304f commit 66d5cf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: ext/pdo_sqlite/pdo_sqlite.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,14 +352,14 @@ static int php_sqlite_collation_callback(void *context, int string1_len, const v
352352
zend_type_error("%s(): Return value of the callback must be of type int, %s returned",
353353
ZSTR_VAL(func_name), zend_zval_value_name(&retval));
354354
zend_string_release(func_name);
355+
zval_ptr_dtor(&retval);
355356
return FAILURE;
356357
}
357358
if (Z_LVAL(retval) > 0) {
358359
ret = 1;
359360
} else if (Z_LVAL(retval) < 0) {
360361
ret = -1;
361362
}
362-
zval_ptr_dtor(&retval);
363363
}
364364

365365
zval_ptr_dtor(&zargs[0]);

0 commit comments

Comments
 (0)