BUG #15838: [contrib] vacuumlo: schema variable checked for NULL three times - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #15838: [contrib] vacuumlo: schema variable checked for NULL three times
Date
Msg-id 15838-3221652c72c5e69d@postgresql.org
Whole thread Raw
Responses Re: BUG #15838: [contrib] vacuumlo: schema variable checked for NULLthree times
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15838
Logged by:          Timur Birsh
Email address:      taem@linukz.org
PostgreSQL version: 11.2
Operating system:   CentOS 7
Description:

Hello,

vacuumlo() has this (starting on line 239):

                if (!schema || !table || !field)
                {
                        fprintf(stderr, "%s", PQerrorMessage(conn));
                        PQclear(res);
                        PQfinish(conn);
                        if (schema != NULL)
                                PQfreemem(schema);
                        if (schema != NULL)
                                PQfreemem(table);
                        if (schema != NULL)
                                PQfreemem(field);
                        return -1;
                }

I think this can be replaced with this:

                if (!schema || !table || !field)
                {
                        fprintf(stderr, "%s", PQerrorMessage(conn));
                        PQclear(res);
                        PQfinish(conn);
                        if (schema != NULL) {
                                PQfreemem(schema);
                                PQfreemem(table);
                                PQfreemem(field);
                        }
                        return -1;
                }

Thanks,
Timur


pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #15833: defining a comment on a domain constraint fails withwrong OID
Next
From: Sasa Vilic
Date:
Subject: Unable to create postgis extension on CentOS7 when using pg11 andnewest postgis 2.5 (postgis25_11-2.5.2-2.rhel7.x86_64) due to undefinedsymbol OGR_GT_Flatten