提交 f4590995 编写于 作者: B Bruce Momjian

The attached patch fixes 2 memory leaks in pg_dump, as well as corrects

a spelling mistake and deletes an antiquated comment.

Neil Conway
上级 43b0f2e2
......@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.49 2002/05/29 01:49:57 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.50 2002/07/02 05:49:51 momjian Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
......@@ -2371,7 +2371,7 @@ _SortToc(ArchiveHandle *AH, TocSortCompareFn fn)
/* Sort it, but ignore the header entries */
qsort(&(tea[1]), AH->tocCount, sizeof(TocEntry *), fn);
/* Rebuild list: this works becuase we have headers at each end */
/* Rebuild list: this works because we have headers at each end */
for (i = 1; i <= AH->tocCount; i++)
{
tea[i]->next = tea[i + 1];
......
......@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.267 2002/06/20 20:29:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.268 2002/07/02 05:49:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -967,10 +967,10 @@ dumpClasses_nodumpData(Archive *fout, char *oid, void *dctxv)
write_msg(NULL, "SQL command to dump the contents of table \"%s\" failed: PQendcopy() failed.\n", classname);
write_msg(NULL, "Error message from server: %s", PQerrorMessage(g_conn));
write_msg(NULL, "The command was: %s\n", q->data);
PQclear(res);
exit_nicely();
}
PQclear(res);
destroyPQExpBuffer(q);
return 1;
}
......@@ -4758,6 +4758,15 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo)
/* Dump Table Comments */
dumpTableComment(fout, tbinfo, reltypename, commentDeps);
if (commentDeps)
{
for (j = 0; (*commentDeps)[j] != NULL; j++)
{
free((void *) (*commentDeps)[j]);
}
free(commentDeps);
}
destroyPQExpBuffer(query);
destroyPQExpBuffer(q);
destroyPQExpBuffer(delq);
......
......@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_dump.h,v 1.88 2002/06/20 20:29:41 momjian Exp $
* $Id: pg_dump.h,v 1.89 2002/07/02 05:49:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -156,11 +156,6 @@ extern char g_comment_end[10];
extern char g_opaque_type[10]; /* name for the opaque type */
/* pg_dump is really two programs in one
one version works with postgres v4r2
and the other works with postgreSQL
the common routines are declared here
*/
/*
* common utility functions
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册