Index: src/bin/pg_dump/pg_dumpall.c
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/bin/pg_dump/pg_dumpall.c,v
retrieving revision 1.10
diff -c -r1.10 pg_dumpall.c
*** src/bin/pg_dump/pg_dumpall.c	22 Nov 2002 03:09:43 -0000	1.10
--- src/bin/pg_dump/pg_dumpall.c	24 Nov 2002 00:48:28 -0000
***************
*** 403,409 ****
  
  	for (i = 0; i < PQntuples(res); i++)
  	{
! 		PQExpBuffer buf = createPQExpBuffer();
  		char	   *dbname = PQgetvalue(res, i, 0);
  		char	   *dbowner = PQgetvalue(res, i, 1);
  		char	   *dbencoding = PQgetvalue(res, i, 2);
--- 403,409 ----
  
  	for (i = 0; i < PQntuples(res); i++)
  	{
! 		PQExpBuffer buf;
  		char	   *dbname = PQgetvalue(res, i, 0);
  		char	   *dbowner = PQgetvalue(res, i, 1);
  		char	   *dbencoding = PQgetvalue(res, i, 2);
***************
*** 413,418 ****
--- 413,420 ----
  		if (strcmp(dbname, "template1") == 0)
  			continue;
  
+ 		buf = createPQExpBuffer();
+ 
  		if (output_clean)
  			appendPQExpBuffer(buf, "DROP DATABASE %s\n;", fmtId(dbname));
  
***************
*** 692,697 ****
--- 694,700 ----
  			exit(1);
  		}
  	}
+ 	PQclear(res);
  
  	return conn;
  }
