[gvfs] dav: Prevent usage of uninitialized variable
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] dav: Prevent usage of uninitialized variable
- Date: Fri, 29 Sep 2017 11:26:22 +0000 (UTC)
commit bf6bd1d5051e6c8fdd9e9dabcdbc3160495018f5
Author: Ondrej Holy <oholy redhat com>
Date: Thu Sep 21 19:44:12 2017 +0200
dav: Prevent usage of uninitialized variable
More warnings are printed when building thanks to meson port. The mounting
loop may be breaked before is_webdav variable is defined. Let's move the
initialization to another place in order to prevent usage of uninitialized
variable and the following warning:
warning: ‘is_webdav’ may be used uninitialized in this function
https://bugzilla.gnome.org/show_bug.cgi?id=786149
daemon/gvfsbackenddav.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 53bebe3..967f1db 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -1893,6 +1893,7 @@ do_mount (GVfsBackend *backend,
res = TRUE;
status = g_vfs_backend_dav_send_message (backend, msg_opts);
is_success = SOUP_STATUS_IS_SUCCESSFUL (status);
+ is_webdav = sm_has_header (msg_opts, "DAV");
/* If SSL is used and the certificate verifies OK, then ssl-strict remains
* on for all further connections.
@@ -1921,8 +1922,6 @@ do_mount (GVfsBackend *backend,
}
}
- is_webdav = sm_has_header (msg_opts, "DAV");
-
if (!is_success || !is_webdav)
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]