From: Joe Conway Date: Thu, 10 May 2012 05:53:17 +0000 (-0700) Subject: PL/pgSQL RETURN NEXT was leaking converted tuples, causing X-Git-Tag: REL9_1_4~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05a86891232e1bd5e43d559f30bec2fc00131f37;p=thirdparty%2Fpostgresql.git PL/pgSQL RETURN NEXT was leaking converted tuples, causing out of memory when looping through large numbers of rows. Flag the converted tuples to be freed. Complaint and patch by Joe. --- diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 7f911b87710..bb9574b1cc7 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -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;