mirror of
git://sourceware.org/git/lvm2.git
synced 2025-08-02 04:22:02 +03:00
sanlock: fix file descriptor leak in error path
Add proper cleanup of file descriptor in the error handling path to prevent resource leaks when sanlock operations fail.
This commit is contained in:
@ -323,8 +323,11 @@ static int read_host_id_file(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
_fclose(file, (char *)daemon_host_id_file);
|
||||
|
||||
out:
|
||||
if (file)
|
||||
_fclose(file, (char *)daemon_host_id_file);
|
||||
|
||||
log_debug("host_id %d from %s", host_id, daemon_host_id_file);
|
||||
return host_id;
|
||||
}
|
||||
|
Reference in New Issue
Block a user