mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Prevent potential file descriptor resource leak
This commit is contained in:
@@ -3108,11 +3108,12 @@ copy_file(const char *src_file, const char *dest_file)
|
|||||||
int a = 0;
|
int a = 0;
|
||||||
|
|
||||||
ptr_old = fopen(src_file, "r");
|
ptr_old = fopen(src_file, "r");
|
||||||
ptr_new = fopen(dest_file, "w");
|
|
||||||
|
|
||||||
if (ptr_old == NULL)
|
if (ptr_old == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
ptr_new = fopen(dest_file, "w");
|
||||||
|
|
||||||
if (ptr_new == NULL)
|
if (ptr_new == NULL)
|
||||||
{
|
{
|
||||||
fclose(ptr_old);
|
fclose(ptr_old);
|
||||||
|
|||||||
Reference in New Issue
Block a user