From c1e82d3f1a0f424087846a079465615eecd4b137 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Tue, 24 May 2016 14:01:46 +0200 Subject: [PATCH] (IOHidManager) Fix adapter leak --- input/drivers_hid/iohidmanager_hid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input/drivers_hid/iohidmanager_hid.c b/input/drivers_hid/iohidmanager_hid.c index 0a0f59ff7b..05cae62032 100644 --- a/input/drivers_hid/iohidmanager_hid.c +++ b/input/drivers_hid/iohidmanager_hid.c @@ -248,8 +248,10 @@ static void iohidmanager_hid_device_remove(void *data, memset(hid->axes[adapter->slot], 0, sizeof(hid->axes)); pad_connection_pad_deinit(&hid->slots[adapter->slot], adapter->slot); - free(adapter); } + + if (adapter) + free(adapter); } static int32_t iohidmanager_hid_device_get_int_property(