git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Version 1.8.15.
[libguestfs.git]
/
daemon
/
realpath.c
diff --git
a/daemon/realpath.c
b/daemon/realpath.c
index
89f7737
..
ff258be
100644
(file)
--- a/
daemon/realpath.c
+++ b/
daemon/realpath.c
@@
-183,7
+183,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);
@@
-194,6
+195,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;
}