Skip to content

Commit 77b68e3

Browse files
committed
Fix copy-pasto in freeing memory on error in vacuumlo.
It's harmless to call PQfreemem() with a NULL argument, so the only consequence was that if allocating 'schema' failed, but allocating 'table' or 'field' succeeded, we would leak a bit of memory. That's highly unlikely to happen, so this is just academical, but let's get it right. Per bug #15838 from Timur Birsh. Backpatch back to 9.5, where the PQfreemem() calls were introduced. Discussion: https://www.postgresql.org/message-id/15838-3221652c72c5e69d@postgresql.org
1 parent a36c84c commit 77b68e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/vacuumlo/vacuumlo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ vacuumlo(const char *database, const struct _param *param)
243243
PQfinish(conn);
244244
if (schema != NULL)
245245
PQfreemem(schema);
246-
if (schema != NULL)
246+
if (table != NULL)
247247
PQfreemem(table);
248-
if (schema != NULL)
248+
if (field != NULL)
249249
PQfreemem(field);
250250
return -1;
251251
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy