mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Fixed a few memory leaks. One indeed was part of a loop.
This commit is contained in:
parent
2b2a50722c
commit
333bc29fcb
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.70 2006/06/25 04:37:55 alvherre Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.71 2006/08/21 10:48:21 meskes Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -320,6 +320,7 @@ readfile(const char *path)
|
|||||||
result[nlines++] = xstrdup(buffer);
|
result[nlines++] = xstrdup(buffer);
|
||||||
|
|
||||||
fclose(infile);
|
fclose(infile);
|
||||||
|
free(buffer);
|
||||||
result[nlines] = NULL;
|
result[nlines] = NULL;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -465,6 +466,7 @@ test_postmaster_connection(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
PQfinish(conn);
|
||||||
print_msg(".");
|
print_msg(".");
|
||||||
pg_usleep(1000000); /* 1 sec */
|
pg_usleep(1000000); /* 1 sec */
|
||||||
}
|
}
|
||||||
@ -854,6 +856,7 @@ do_status(void)
|
|||||||
if (optlines != NULL)
|
if (optlines != NULL)
|
||||||
for (; *optlines != NULL; optlines++)
|
for (; *optlines != NULL; optlines++)
|
||||||
fputs(*optlines, stdout);
|
fputs(*optlines, stdout);
|
||||||
|
free(optlines);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user