mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Coverity: Don't close fd_cwd if fd_cwd == -1.
This commit is contained in:
@@ -179,7 +179,8 @@ do_case_sensitive_path (const char *path)
|
||||
}
|
||||
}
|
||||
|
||||
close (fd_cwd);
|
||||
if (fd_cwd >= 0)
|
||||
close (fd_cwd);
|
||||
|
||||
ret[next] = '\0';
|
||||
char *retp = strdup (ret);
|
||||
@@ -190,6 +191,8 @@ do_case_sensitive_path (const char *path)
|
||||
return retp; /* caller frees */
|
||||
|
||||
error:
|
||||
close (fd_cwd);
|
||||
if (fd_cwd >= 0)
|
||||
close (fd_cwd);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user