Skip to content

Commit 333bc29

Browse files
author
Michael Meskes
committed
Fixed a few memory leaks. One indeed was part of a loop.
1 parent 2b2a507 commit 333bc29

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bin/pg_ctl/pg_ctl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.70 2006/06/25 04:37:55 alvherre Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.71 2006/08/21 10:48:21 meskes Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -320,6 +320,7 @@ readfile(const char *path)
320320
result[nlines++] = xstrdup(buffer);
321321

322322
fclose(infile);
323+
free(buffer);
323324
result[nlines] = NULL;
324325

325326
return result;
@@ -465,6 +466,7 @@ test_postmaster_connection(void)
465466
}
466467
else
467468
{
469+
PQfinish(conn);
468470
print_msg(".");
469471
pg_usleep(1000000); /* 1 sec */
470472
}
@@ -854,6 +856,7 @@ do_status(void)
854856
if (optlines != NULL)
855857
for (; *optlines != NULL; optlines++)
856858
fputs(*optlines, stdout);
859+
free(optlines);
857860
return;
858861
}
859862
}

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