diff options
author | Ondrej Holy <oholy@redhat.com> | 2017-03-17 13:54:15 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2017-03-23 11:24:16 +0100 |
commit | 67faa3b09f7768e271a3037268e3f8cb1137f447 (patch) | |
tree | 3f8cee43eb5f5378d6b70ed0f78d95ca8e0b1dcc | |
parent | b9b649e2f4d0298baabbcedf83e8f8d627c906cc (diff) | |
download | gvfs-67faa3b09f7768e271a3037268e3f8cb1137f447.tar.gz |
google: Prevent potential crashes if resolve_dir fails
Initialize pointers properly in order to avoid usage of unitialized,
or already freed memory.
This issues were revealed by coverity scan.
-rw-r--r-- | daemon/gvfsbackendgoogle.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c index 1422760f..ef1b4ad1 100644 --- a/daemon/gvfsbackendgoogle.c +++ b/daemon/gvfsbackendgoogle.c @@ -748,7 +748,7 @@ resolve_dir_and_rebuild (GVfsBackendGoogle *self, GDataEntry *parent; GDataEntry *ret_val = NULL; GError *local_error; - gchar *basename; + gchar *basename = NULL; local_error = NULL; parent = resolve_dir (self, filename, &basename, &local_error); @@ -1180,6 +1180,7 @@ g_vfs_backend_google_copy (GVfsBackend *_self, if (!destination_not_directory) { g_free (destination_basename); + destination_basename = NULL; error = NULL; destination_parent = resolve_dir (self, destination, &destination_basename, &error); |