Fixed a few trivial memory leaks reported by Coverity just to test my setup.
This commit is contained in:
parent
fc19744e58
commit
4e23d6e07d
@ -42,7 +42,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
* Portions taken from FreeBSD.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.120 2006/07/31 01:16:37 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.121 2006/08/20 16:08:09 meskes Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -419,6 +419,7 @@ readfile(char *path)
|
||||
}
|
||||
|
||||
fclose(infile);
|
||||
free(buffer);
|
||||
result[nlines] = NULL;
|
||||
|
||||
return result;
|
||||
@ -1058,6 +1059,7 @@ set_short_version(char *short_version, char *extrapath)
|
||||
progname, path, strerror(errno));
|
||||
exit_nicely();
|
||||
}
|
||||
free(path);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1085,6 +1087,7 @@ set_null_conf(void)
|
||||
progname, path, strerror(errno));
|
||||
exit_nicely();
|
||||
}
|
||||
free(path);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1543,6 +1546,9 @@ get_set_pwd(void)
|
||||
PG_CMD_PRINTF2("ALTER USER \"%s\" WITH PASSWORD E'%s';\n",
|
||||
username, escape_quotes(pwd1));
|
||||
|
||||
/* MM: pwd1 is no longer needed, freeing it */
|
||||
free(pwd1);
|
||||
|
||||
PG_CMD_CLOSE;
|
||||
|
||||
check_ok();
|
||||
|
Loading…
x
Reference in New Issue
Block a user