Fix PDO pgsql memory leak with scrollable cursors
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Sep 2019 08:50:10 +0000 (10:50 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Sep 2019 08:50:10 +0000 (10:50 +0200)
ext/pdo_pgsql/pgsql_statement.c

index a07c8117ca5fa01e6d9e12fd6edba948a7e16ca0..d830d57c1839bb665bc47bcddbbe5f57f25e7790 100644 (file)
@@ -149,7 +149,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt)
 
                if (S->is_prepared) {
                        spprintf(&q, 0, "CLOSE %s", S->cursor_name);
-                       S->result = PQexec(H->server, q);
+                       PQclear(PQexec(H->server, q));
                        efree(q);
                }