summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-01-11 23:16:37 -0800
committerTim Prouty <tprouty@samba.org>2009-01-11 23:29:14 -0800
commit44937c55ff69f29d44cf6ef34a7e4050816b30a4 (patch)
treee62188406086cd83bbece89d5539a2f9ff5ce519 /source3
parent9872dbf439e94ffd56019f789145c4b5eb3e606c (diff)
downloadsamba-44937c55ff69f29d44cf6ef34a7e4050816b30a4.tar.gz
samba-44937c55ff69f29d44cf6ef34a7e4050816b30a4.tar.bz2
samba-44937c55ff69f29d44cf6ef34a7e4050816b30a4.zip
s3: Fix uninitialized variable in OneFS streams
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/onefs_streams.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/modules/onefs_streams.c b/source3/modules/onefs_streams.c
index 55ce11ecf5..184fe4f0c9 100644
--- a/source3/modules/onefs_streams.c
+++ b/source3/modules/onefs_streams.c
@@ -132,7 +132,8 @@ int onefs_rename(vfs_handle_struct *handle, const char *oldname,
{
TALLOC_CTX *frame = NULL;
int ret = -1;
- int dir_fd, saved_errno;
+ int dir_fd = -1;
+ int saved_errno;
bool old_is_stream;
bool new_is_stream;
char *obase = NULL;
@@ -182,7 +183,9 @@ int onefs_rename(vfs_handle_struct *handle, const char *oldname,
done:
saved_errno = errno;
- close(dir_fd);
+ if (dir_fd >= 0) {
+ close(dir_fd);
+ }
errno = saved_errno;
TALLOC_FREE(frame);
return ret;