Re: Nitpicking: unnecessary NULL-pointer check in pg_upgrade's controldata.c - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Nitpicking: unnecessary NULL-pointer check in pg_upgrade's controldata.c
Date
Msg-id 20150626130639.GE4797@alap3.anarazel.de
Whole thread Raw
In response to Nitpicking: unnecessary NULL-pointer check in pg_upgrade's controldata.c  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Nitpicking: unnecessary NULL-pointer check in pg_upgrade's controldata.c  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

On 2015-06-26 22:03:05 +0900, Michael Paquier wrote:
> 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.

FWIW, I think these type of coverity items should just be discarded with
prejudice. Fixing them doesn't seem to buy anything and there's enough
actually worthwhile stuff going on.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Nitpicking: unnecessary NULL-pointer check in pg_upgrade's controldata.c
Next
From: Robert Haas
Date:
Subject: Re: PGXS "check" target forcing an install ?