[gnome-games] gamepad: Fix NULL check in LinuxRawGamepad finalize



commit 23da729015f0d79dc253dfc731ecf996c43af418
Author: theawless <theawless gmail com>
Date:   Mon May 15 12:51:15 2017 +0530

    gamepad: Fix NULL check in LinuxRawGamepad finalize
    
    We want to free non-NULL pointers, not NULL ones.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782549

 src/gamepad/linux/linux-raw-gamepad.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gamepad/linux/linux-raw-gamepad.c b/src/gamepad/linux/linux-raw-gamepad.c
index 11b0753..b7b8cba 100644
--- a/src/gamepad/linux/linux-raw-gamepad.c
+++ b/src/gamepad/linux/linux-raw-gamepad.c
@@ -368,7 +368,7 @@ games_linux_raw_gamepad_finalize (GObject *object)
   remove_event_source (self);
   if (self->device != NULL)
     libevdev_free (self->device);
-  if (self->guid == NULL)
+  if (self->guid != NULL)
     g_free (self->guid);
 
   G_OBJECT_CLASS (games_linux_raw_gamepad_parent_class)->finalize (object);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]