|
From: Jason G. <kil...@gm...> - 2018-04-17 17:53:48
|
Reported by PVS Studio:
V773 The function was exited without releasing the 'devices' pointer.
A memory leak is possible.
Signed-off-by: Jason Gerecke <jas...@wa...>
---
libwacom/libwacom-database.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
index 33c4393..1da9adf 100644
--- a/libwacom/libwacom-database.c
+++ b/libwacom/libwacom-database.c
@@ -854,6 +854,7 @@ libwacom_list_devices_from_database(const WacomDeviceDatabase *db, WacomError *e
list = calloc (g_list_length (devices) + 1, sizeof (WacomDevice *));
if (!list) {
libwacom_error_set(error, WERROR_BAD_ALLOC, "Memory allocation failed");
+ g_list_free (devices);
return NULL;
}
--
2.17.0
|