PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15838
PG Version11.2
OSCentOS 7
Opened2019-06-07 06:15:30+00
Reported byTimur Birsh
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15838
Logged by:          Timur Birsh
Email address:      (redacted)
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

Messages

DateAuthorSubject
2019-06-07 06:15:30+00PG Bug reporting formBUG #15838: [contrib] vacuumlo: schema variable checked for NULL three times
2019-06-07 09:21:07+00Heikki LinnakangasRe: BUG #15838: [contrib] vacuumlo: schema variable checked for NULL three times
2019-06-07 09:29:05+00Timur BirshRe: BUG #15838: [contrib] vacuumlo: schema variable checked for NULL three times