pg_dumpall failed on groups having no members. Per report from
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Mar 2003 22:45:49 +0000 (22:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 14 Mar 2003 22:45:49 +0000 (22:45 +0000)
Nick Eskelinen.

src/bin/pg_dump/pg_dumpall.c

index 7970651e8002bbfbb02b64a227ac25726ee01667..52facb459a57d661c4630d53f852ead4c146ce66 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.15 2003/03/06 21:45:52 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.16 2003/03/14 22:45:49 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -327,7 +327,7 @@ dumpGroups(PGconn *conn)
 
        val = strdup(PQgetvalue(res, i, 2));
        tok = strtok(val, ",{}");
-       do
+       while (tok)
        {
            PGresult   *res2;
            PQExpBuffer buf2 = createPQExpBuffer();
@@ -347,7 +347,7 @@ dumpGroups(PGconn *conn)
 
            tok = strtok(NULL, "{},");
        }
-       while (tok);
+       free(val);
 
        printf("%s", buf->data);
        destroyPQExpBuffer(buf);