Cygwin: Fix uninitialized use of fh in strace output in stat_worker()
Move strace output to fix uninitalized use of fh introduced in previous commit.
../../../../src/winsup/cygwin/syscalls.cc: In function ‘int stat_worker(path_conv&, stat*)’:
../../../../src/winsup/cygwin/syscalls.cc:1971:69: error: ‘fh’ may be used uninitialized [-Werror=maybe-uninitialized]
Fixes: 42b44044b3
("Cygwin: Fix Windows file handle leak in stat("file", -1)")
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
42b44044b3
commit
8b0b719d49
|
@ -1967,13 +1967,14 @@ stat_worker (path_conv &pc, struct stat *buf)
|
|||
{
|
||||
fhandler_base *fh;
|
||||
|
||||
debug_printf ("(%S, %p, %p), file_attributes %d",
|
||||
pc.get_nt_native_path (), buf, fh, (DWORD) *fh);
|
||||
memset (buf, 0, sizeof (*buf));
|
||||
|
||||
if (!(fh = build_fh_pc (pc)))
|
||||
__leave;
|
||||
|
||||
debug_printf ("(%S, %p, %p), file_attributes %d",
|
||||
pc.get_nt_native_path (), buf, fh, (DWORD) *fh);
|
||||
|
||||
res = fh->fstat (buf);
|
||||
if (!res)
|
||||
fh->stat_fixup (buf);
|
||||
|
|
Loading…
Reference in New Issue