Attached is a patch that fixes two non-bugs. There's plenty of redundant NULL checks around the place but these were just so silly I figure they're worth fixing.
The first checks 'file' the line after having dereferenced it. The second checks 'currSchema' where the code is designed to never allow it to be NULL. Currently they've fixed the bogus errors relating to elog(), but not yet the ones relating to ereport(). There's still mountains of crap to wade through and not a single real bug found yet. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to > litigate.
Index: src/bin/psql/prompt.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/bin/psql/prompt.c,v retrieving revision 1.43 diff -u -r1.43 prompt.c --- src/bin/psql/prompt.c 5 Mar 2006 15:58:52 -0000 1.43 +++ src/bin/psql/prompt.c 19 Apr 2006 11:58:37 -0000 @@ -256,8 +256,7 @@ cmdend = strcspn(file, "`"); file[cmdend] = '\0'; - if (file) - fd = popen(file, "r"); + fd = popen(file, "r"); if (fd) { fgets(buf, MAX_PROMPT_SIZE - 1, fd); Index: src/bin/pg_dump/pg_backup_archiver.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v retrieving revision 1.126 diff -u -r1.126 pg_backup_archiver.c --- src/bin/pg_dump/pg_backup_archiver.c 12 Apr 2006 22:18:48 -0000 1.126 +++ src/bin/pg_dump/pg_backup_archiver.c 19 Apr 2006 11:58:37 -0000 @@ -2130,8 +2130,7 @@ AH->currUser = strdup(""); /* don't assume we still know the output schema */ - if (AH->currSchema) - free(AH->currSchema); + free(AH->currSchema); AH->currSchema = strdup(""); AH->currWithOids = -1; @@ -2229,8 +2228,7 @@ else ahprintf(AH, "%s;\n\n", qry->data); - if (AH->currSchema) - free(AH->currSchema); + free(AH->currSchema); AH->currSchema = strdup(schemaName); destroyPQExpBuffer(qry);
signature.asc
Description: Digital signature