|
From: Peter H. <pet...@wh...> - 2018-04-18 04:31:41
|
On Tue, Apr 17, 2018 at 10:53:19AM -0700, Jason Gerecke wrote:
> 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
Reviewed-by: Peter Hutterer <pet...@wh...>
Cheers,
Peter
|