Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d367d41d
Commit
d367d41d
authored
Mar 08, 2011
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix file descriptor leaks in pg_upgrade in failure code paths.
parent
51c01244
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
17 deletions
+34
-17
contrib/pg_upgrade/check.c
contrib/pg_upgrade/check.c
+6
-2
contrib/pg_upgrade/file.c
contrib/pg_upgrade/file.c
+6
-0
contrib/pg_upgrade/server.c
contrib/pg_upgrade/server.c
+2
-4
contrib/pg_upgrade/version.c
contrib/pg_upgrade/version.c
+3
-2
contrib/pg_upgrade/version_old_8_3.c
contrib/pg_upgrade/version_old_8_3.c
+17
-9
No files found.
contrib/pg_upgrade/check.c
View file @
d367d41d
...
...
@@ -515,9 +515,11 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo *cluster)
PQfinish
(
conn
);
}
if
(
script
)
fclose
(
script
);
if
(
found
)
{
fclose
(
script
);
pg_log
(
PG_REPORT
,
"fatal
\n
"
);
pg_log
(
PG_FATAL
,
"| Your installation contains
\"
/contrib/isn
\"
functions
\n
"
...
...
@@ -616,9 +618,11 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
PQfinish
(
conn
);
}
if
(
script
)
fclose
(
script
);
if
(
found
)
{
fclose
(
script
);
pg_log
(
PG_REPORT
,
"fatal
\n
"
);
pg_log
(
PG_FATAL
,
"| Your installation contains one of the reg* data types in
\n
"
...
...
contrib/pg_upgrade/file.c
View file @
d367d41d
...
...
@@ -302,7 +302,10 @@ pg_scandir_internal(const char *dirname,
(
size_t
)
((
name_num
+
1
)
*
sizeof
(
struct
dirent
*
)));
if
(
*
namelist
==
NULL
)
{
closedir
(
dirdesc
);
return
-
1
;
}
entrysize
=
sizeof
(
struct
dirent
)
-
sizeof
(
direntry
->
d_name
)
+
strlen
(
direntry
->
d_name
)
+
1
;
...
...
@@ -310,7 +313,10 @@ pg_scandir_internal(const char *dirname,
(
*
namelist
)[
name_num
]
=
(
struct
dirent
*
)
malloc
(
entrysize
);
if
((
*
namelist
)[
name_num
]
==
NULL
)
{
closedir
(
dirdesc
);
return
-
1
;
}
memcpy
((
*
namelist
)[
name_num
],
direntry
,
entrysize
);
...
...
contrib/pg_upgrade/server.c
View file @
d367d41d
...
...
@@ -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
;
}
...
...
contrib/pg_upgrade/version.c
View file @
d367d41d
...
...
@@ -62,10 +62,11 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, bool check_mode)
PQfinish
(
conn
);
}
if
(
script
)
fclose
(
script
);
if
(
found
)
{
if
(
!
check_mode
)
fclose
(
script
);
report_status
(
PG_WARNING
,
"warning"
);
if
(
check_mode
)
pg_log
(
PG_WARNING
,
"
\n
"
...
...
contrib/pg_upgrade/version_old_8_3.c
View file @
d367d41d
...
...
@@ -87,9 +87,11 @@ old_8_3_check_for_name_data_type_usage(ClusterInfo *cluster)
PQfinish
(
conn
);
}
if
(
script
)
fclose
(
script
);
if
(
found
)
{
fclose
(
script
);
pg_log
(
PG_REPORT
,
"fatal
\n
"
);
pg_log
(
PG_FATAL
,
"| Your installation contains the
\"
name
\"
data type in
\n
"
...
...
@@ -175,9 +177,11 @@ old_8_3_check_for_tsquery_usage(ClusterInfo *cluster)
PQfinish
(
conn
);
}
if
(
script
)
fclose
(
script
);
if
(
found
)
{
fclose
(
script
);
pg_log
(
PG_REPORT
,
"fatal
\n
"
);
pg_log
(
PG_FATAL
,
"| Your installation contains the
\"
tsquery
\"
data type.
\n
"
...
...
@@ -314,10 +318,11 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
PQfinish
(
conn
);
}
if
(
script
)
fclose
(
script
);
if
(
found
)
{
if
(
!
check_mode
)
fclose
(
script
);
report_status
(
PG_WARNING
,
"warning"
);
if
(
check_mode
)
pg_log
(
PG_WARNING
,
"
\n
"
...
...
@@ -424,10 +429,11 @@ old_8_3_invalidate_hash_gin_indexes(ClusterInfo *cluster, bool check_mode)
PQfinish
(
conn
);
}
if
(
script
)
fclose
(
script
);
if
(
found
)
{
if
(
!
check_mode
)
fclose
(
script
);
report_status
(
PG_WARNING
,
"warning"
);
if
(
check_mode
)
pg_log
(
PG_WARNING
,
"
\n
"
...
...
@@ -553,10 +559,11 @@ old_8_3_invalidate_bpchar_pattern_ops_indexes(ClusterInfo *cluster,
PQfinish
(
conn
);
}
if
(
script
)
fclose
(
script
);
if
(
found
)
{
if
(
!
check_mode
)
fclose
(
script
);
report_status
(
PG_WARNING
,
"warning"
);
if
(
check_mode
)
pg_log
(
PG_WARNING
,
"
\n
"
...
...
@@ -672,7 +679,8 @@ old_8_3_create_sequence_script(ClusterInfo *cluster)
PQfinish
(
conn
);
}
if
(
found
)
if
(
script
)
fclose
(
script
);
check_ok
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment