projects
/
users
/
rhaas
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59f71a0
)
vacuumlo: Avoid unlikely memory leak.
author
Robert Haas
<rhaas@postgresql.org>
Wed, 14 Jan 2015 20:14:20 +0000
(15:14 -0500)
committer
Robert Haas
<rhaas@postgresql.org>
Wed, 14 Jan 2015 20:14:20 +0000
(15:14 -0500)
Spotted by Coverity. This isn't likely to matter in practice, but
there's no harm in fixing it.
Michael Paquier
contrib/vacuumlo/vacuumlo.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/vacuumlo/vacuumlo.c
b/contrib/vacuumlo/vacuumlo.c
index 43130dca8afcf181a990dd1bdfe260896c2d3fa8..ca0d3048b82a201290f83c19113931e0a5765248 100644
(file)
--- a/
contrib/vacuumlo/vacuumlo.c
+++ b/
contrib/vacuumlo/vacuumlo.c
@@
-240,6
+240,12
@@
vacuumlo(const char *database, const struct _param * param)
fprintf(stderr, "Out of memory\n");
PQclear(res);
PQfinish(conn);
+ if (schema != NULL)
+ PQfreemem(schema);
+ if (schema != NULL)
+ PQfreemem(table);
+ if (schema != NULL)
+ PQfreemem(field);
return -1;
}
@@
-256,6
+262,9
@@
vacuumlo(const char *database, const struct _param * param)
PQclear(res2);
PQclear(res);
PQfinish(conn);
+ PQfreemem(schema);
+ PQfreemem(table);
+ PQfreemem(field);
return -1;
}
PQclear(res2);