Nitpicking: unnecessary NULL-pointer check in pg_upgrade's controldata.c

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Nitpicking: unnecessary NULL-pointer check in pg_upgrade's controldata.c
Date: 2015-06-26 13:03:05
Message-ID: CAB7nPqTmLvKZKrtNQ0+jc7SAnKDe0w_udkt8JCO6z_5Lgq5H_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Coverity is nitpickingly pointing out the following thing:
--- a/src/bin/pg_upgrade/controldata.c
+++ b/src/bin/pg_upgrade/controldata.c
@@ -402,8 +402,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
}
}

- if (output)
- pclose(output);
+ pclose(output);
The thing is that output can never be NULL, pg_upgrade leaving with
pg_fatal before coming to this code path. Hence this NULL check could
be simply removed.
Regards,
--
Michael

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-06-26 13:06:39 Re: Nitpicking: unnecessary NULL-pointer check in pg_upgrade's controldata.c
Previous Message Robert Haas 2015-06-26 12:56:55 Re: RFC: replace pg_stat_activity.waiting with something more descriptive