From 6e9f6de1bcbdc2deec72b492b0d53e85e36a35bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Voltz?= Date: Mon, 10 Aug 2015 21:49:38 +0200 Subject: [PATCH] fix for #300132 - free memory allocated by sane_get_devices() --- backend/tamarack.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/tamarack.c b/backend/tamarack.c index 9baec51f4..e7073af91 100644 --- a/backend/tamarack.c +++ b/backend/tamarack.c @@ -77,6 +77,7 @@ #define TAMARACK_CONFIG_FILE "tamarack.conf" +static const SANE_Device **devlist = NULL; static int num_devices; static Tamarack_Device *first_dev; static Tamarack_Scanner *first_handle; @@ -950,12 +951,14 @@ sane_exit (void) free ((void *) dev->sane.model); free (dev); } + + if (devlist) + free (devlist); } SANE_Status sane_get_devices (const SANE_Device ***device_list, SANE_Bool local_only) { - static const SANE_Device **devlist = 0; Tamarack_Device *dev; int i;