1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: reset FILE on error path

Although fclose() fails - we should not be retrying with
already released stucture.
This commit is contained in:
Zdenek Kabelac 2024-03-28 21:15:38 +01:00
parent 59b46fc8cd
commit 7ec7d8cf54

View File

@ -1749,8 +1749,10 @@ int device_ids_write(struct cmd_context *cmd)
goto_out;
if (fsync(fileno(fp)) < 0)
goto_out;
if (fclose(fp) < 0)
if (fclose(fp) < 0) {
fp = NULL;
goto_out;
}
fp = NULL;