git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
210c4cc
)
Coverity: Don't close fd_cwd if fd_cwd == -1.
author
Richard W.M. Jones
<rjones@redhat.com>
Wed, 8 Jun 2011 21:04:25 +0000
(22:04 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Mon, 13 Jun 2011 13:10:29 +0000
(14:10 +0100)
(cherry picked from commit
76dfb74324fa0daa343d7edf89bd05e1fe7b4db0
)
daemon/realpath.c
patch
|
blob
|
history
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;
}