Re: [PATCHES] Memory leak in tuplestore_end()

2007-08-02 Thread Neil Conway
On Wed, 2007-08-01 at 16:49 -0700, Neil Conway wrote:
 Attached is a patch which fixes a memory leak in tuplestore_end().

Applied to HEAD, and to back branches as far back as 7.4.

-Neil



---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[PATCHES] Memory leak in tuplestore_end()

2007-08-01 Thread Neil Conway
Attached is a patch which fixes a memory leak in tuplestore_end().
Barring any objections, I'll apply this to HEAD and back branches
tomorrow.

-Neil

Index: source/src/backend/utils/sort/tuplestore.c
===
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/backend/utils/sort/tuplestore.c,v
retrieving revision 1.33
diff -p -c -r1.33 tuplestore.c
*** source/src/backend/utils/sort/tuplestore.c	7 Jun 2007 19:19:57 -	1.33
--- source/src/backend/utils/sort/tuplestore.c	1 Aug 2007 23:45:24 -
*** tuplestore_end(Tuplestorestate *state)
*** 322,327 
--- 322,328 
  			pfree(state-memtuples[i]);
  		pfree(state-memtuples);
  	}
+ 	pfree(state);
  }
  
  /*

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly