]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
PL/pgSQL RETURN NEXT was leaking converted tuples, causing
authorJoe Conway <mail@joeconway.com>
Thu, 10 May 2012 05:53:17 +0000 (22:53 -0700)
committerJoe Conway <mail@joeconway.com>
Thu, 10 May 2012 05:53:17 +0000 (22:53 -0700)
out of memory when looping through large numbers of rows.
Flag the converted tuples to be freed. Complaint and patch
by Joe.

src/pl/plpgsql/src/pl_exec.c

index 7f911b8771009686b91b0e029e4848939a727124..bb9574b1cc72c5c8a195784e1a34d3d0a31a8f8e 100644 (file)
@@ -2431,6 +2431,7 @@ exec_stmt_return_next(PLpgSQL_execstate *estate,
                                        {
                                                tuple = do_convert_tuple(tuple, tupmap);
                                                free_conversion_map(tupmap);
+                                               free_tuple = true;
                                        }
                                }
                                break;