1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Fix file descriptor leaks in pg_upgrade in failure code paths.

This commit is contained in:
Bruce Momjian
2011-03-08 21:35:42 -05:00
parent 51c0124481
commit d367d41d66
5 changed files with 34 additions and 17 deletions

View File

@ -144,11 +144,9 @@ get_major_server_version(ClusterInfo *cluster)
if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
sscanf(cluster->major_version_str, "%d.%d", &integer_version,
&fractional_version) != 2)
{
pg_log(PG_FATAL, "could not get version from %s\n", datadir);
fclose(version_fd);
return 0;
}
fclose(version_fd);
return (100 * integer_version + fractional_version) * 100;
}