From: Tim Prouty Date: Mon, 12 Jan 2009 07:16:37 +0000 (-0800) Subject: s3: Fix uninitialized variable in OneFS streams X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=44937c55ff69f29d44cf6ef34a7e4050816b30a4;p=metze%2Fsamba%2Fwip.git s3: Fix uninitialized variable in OneFS streams --- diff --git a/source3/modules/onefs_streams.c b/source3/modules/onefs_streams.c index 55ce11ecf552..184fe4f0c99a 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;