From fe4a0f717c1951f3bdecd3a147e1846962e9d8a3 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 11 Oct 2012 15:03:41 +0300 Subject: [PATCH] hog: Fix passing NULL pointer to g_attrib_unregister The hogdev->attrib pointer can be NULL if we got disconnected. --- profiles/input/hog_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c index d88bc21f0..f6e945ea4 100644 --- a/profiles/input/hog_device.c +++ b/profiles/input/hog_device.c @@ -686,7 +686,9 @@ static void report_free(void *data) struct report *report = data; struct hog_device *hogdev = report->hogdev; - g_attrib_unregister(hogdev->attrib, report->notifyid); + if (hogdev->attrib) + g_attrib_unregister(hogdev->attrib, report->notifyid); + g_free(report->decl); g_free(report); } -- 2.47.3