[clutter/clutter-1.16] input-device: Guard against double free
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.16] input-device: Guard against double free
- Date: Sun, 1 Dec 2013 23:30:40 +0000 (UTC)
commit f9e8c2147edea09039061d4c3ba0eb0ca69afab1
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Nov 29 15:43:45 2013 +0000
input-device: Guard against double free
Dispose() may be called more than once, so calling g_free directly
on the device name is unsafe. Instead, use g_clear_pointer() to
make sure we don't attempt to free the memory again.
https://bugzilla.gnome.org/show_bug.cgi?id=719563
clutter/clutter-input-device.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
index 07951e3..848db18 100644
--- a/clutter/clutter-input-device.c
+++ b/clutter/clutter-input-device.c
@@ -81,7 +81,7 @@ clutter_input_device_dispose (GObject *gobject)
{
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (gobject);
- g_free (device->device_name);
+ g_clear_pointer (&device->device_name, g_free);
if (device->associated != NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]