summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRazvan Chitu <razvan.ch95@gmail.com>2016-02-24 15:20:49 +0200
committerRazvan Chitu <razvan.ch95@gmail.com>2016-02-24 18:05:35 +0200
commit9bc857ce6f8888db32f7abc9f4caebefeabf9a59 (patch)
tree39048704b1ae86f9e526d7f5b72abadf32d67486
parent0d979f2a61f1600164f2ccfd55142b1c7d2a5c31 (diff)
downloadnautilus-9bc857ce6f8888db32f7abc9f4caebefeabf9a59.tar.gz
progress-info: check destination before referencing it
The progress info destination is obtainable through a getter function that returns a reference to it. This reference is created without checking if the destination is not null, which leads to critical warnings. In order to fix this, check the destination before creating the reference. https://bugzilla.gnome.org/show_bug.cgi?id=762609
-rw-r--r--libnautilus-private/nautilus-progress-info.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libnautilus-private/nautilus-progress-info.c b/libnautilus-private/nautilus-progress-info.c
index de913a335..95e7512bc 100644
--- a/libnautilus-private/nautilus-progress-info.c
+++ b/libnautilus-private/nautilus-progress-info.c
@@ -726,10 +726,12 @@ nautilus_progress_info_set_destination (NautilusProgressInfo *info,
GFile *
nautilus_progress_info_get_destination (NautilusProgressInfo *info)
{
- GFile *destination;
+ GFile *destination = NULL;
G_LOCK (progress_info);
- destination = g_object_ref (info->destination);
+ if (info->destination) {
+ destination = g_object_ref (info->destination);
+ }
G_UNLOCK (progress_info);
return destination;