mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +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;
|
||||
|
||||
ptr_old = fopen(src_file, "r");
|
||||
ptr_new = fopen(dest_file, "w");
|
||||
|
||||
if (ptr_old == NULL)
|
||||
return false;
|
||||
|
||||
ptr_new = fopen(dest_file, "w");
|
||||
|
||||
if (ptr_new == NULL)
|
||||
{
|
||||
fclose(ptr_old);
|
||||
|
||||
Reference in New Issue
Block a user