Skip to content

Commit 7492232

Browse files
committed
fix: pgsqlSetNoticeCallback: memory leak
The PostgreSQL-provided message was zvaled and not freed.
1 parent f8a7e5d commit 7492232

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/pdo_pgsql/pgsql_driver.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ static void _pdo_pgsql_notice(pdo_dbh_t *dbh, const char *message) /* {{{ */
112112
fc->fci.param_count = 1;
113113
fc->fci.params = &zarg;
114114
fc->fci.retval = &retval;
115-
if ((ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC)) == FAILURE) {
115+
ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC);
116+
zval_ptr_dtor(&zarg);
117+
if (ret == FAILURE) {
116118
pdo_raise_impl_error(dbh, NULL, "HY000", "could not call user-supplied function" TSRMLS_CC);
117119
}
118120
}

0 commit comments

Comments
 (0)