Remove overenthusiastic free'ing of comment dependencies; could lead to
authorTom Lane <[email protected]>
Fri, 27 Dec 2002 17:10:55 +0000 (17:10 +0000)
committerTom Lane <[email protected]>
Fri, 27 Dec 2002 17:10:55 +0000 (17:10 +0000)
core dump in pg_dump when dumping views having comments.  See bug #855.

src/bin/pg_dump/pg_dump.c

index 3c5093e159993a944e45d6876271a436de5afd8d..a9cd4a4fe8cfb33670ef27730990a9b637b6bbdf 100644 (file)
@@ -22,7 +22,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.1 2002/12/01 18:44:09 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.2 2002/12/27 17:10:55 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -5444,12 +5444,7 @@ 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);
-   }
+   /* commentDeps now belongs to the archive entry ... don't free it! */
 
    destroyPQExpBuffer(query);
    destroyPQExpBuffer(q);