Skip to content

Commit 4a0a5f2

Browse files
committed
vacuumlo: Avoid unlikely memory leak.
Spotted by Coverity. This isn't likely to matter in practice, but there's no harm in fixing it. Michael Paquier
1 parent 59f71a0 commit 4a0a5f2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/vacuumlo/vacuumlo.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ vacuumlo(const char *database, const struct _param * param)
240240
fprintf(stderr, "Out of memory\n");
241241
PQclear(res);
242242
PQfinish(conn);
243+
if (schema != NULL)
244+
PQfreemem(schema);
245+
if (schema != NULL)
246+
PQfreemem(table);
247+
if (schema != NULL)
248+
PQfreemem(field);
243249
return -1;
244250
}
245251

@@ -256,6 +262,9 @@ vacuumlo(const char *database, const struct _param * param)
256262
PQclear(res2);
257263
PQclear(res);
258264
PQfinish(conn);
265+
PQfreemem(schema);
266+
PQfreemem(table);
267+
PQfreemem(field);
259268
return -1;
260269
}
261270
PQclear(res2);

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