Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e23d6e

Browse files
author
Michael Meskes
committed
Fixed a few trivial memory leaks reported by Coverity just to test my setup.
1 parentfc19744 commit4e23d6e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.120 2006/07/31 01:16:37 tgl Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.121 2006/08/2016:08:09 meskes Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -419,6 +419,7 @@ readfile(char *path)
419419
}
420420

421421
fclose(infile);
422+
free(buffer);
422423
result[nlines]=NULL;
423424

424425
returnresult;
@@ -1058,6 +1059,7 @@ set_short_version(char *short_version, char *extrapath)
10581059
progname,path,strerror(errno));
10591060
exit_nicely();
10601061
}
1062+
free(path);
10611063
}
10621064

10631065
/*
@@ -1085,6 +1087,7 @@ set_null_conf(void)
10851087
progname,path,strerror(errno));
10861088
exit_nicely();
10871089
}
1090+
free(path);
10881091
}
10891092

10901093
/*
@@ -1543,6 +1546,9 @@ get_set_pwd(void)
15431546
PG_CMD_PRINTF2("ALTER USER \"%s\" WITH PASSWORD E'%s';\n",
15441547
username,escape_quotes(pwd1));
15451548

1549+
/* MM: pwd1 is no longer needed, freeing it */
1550+
free(pwd1);
1551+
15461552
PG_CMD_CLOSE;
15471553

15481554
check_ok();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp