kopia lustrzana https://gitlab.com/sane-project/backends
plustek.c: Free memory malloced in sane_get_devices() in sane_exit()
rodzic
95d59dfee4
commit
ad54d68112
|
@ -121,10 +121,11 @@
|
||||||
|
|
||||||
/************************** global vars **************************************/
|
/************************** global vars **************************************/
|
||||||
|
|
||||||
static int num_devices;
|
static int num_devices;
|
||||||
static Plustek_Device *first_dev;
|
static Plustek_Device *first_dev;
|
||||||
static Plustek_Scanner *first_handle;
|
static Plustek_Scanner *first_handle;
|
||||||
static unsigned long tsecs = 0;
|
static const SANE_Device **devlist = NULL;
|
||||||
|
static unsigned long tsecs = 0;
|
||||||
|
|
||||||
static ModeParam mode_params[] =
|
static ModeParam mode_params[] =
|
||||||
{
|
{
|
||||||
|
@ -836,11 +837,17 @@ void sane_exit( void )
|
||||||
free( dev );
|
free( dev );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* cleanup the device list if exist... */
|
||||||
|
if( devlist )
|
||||||
|
free( devlist );
|
||||||
|
|
||||||
|
/* call driver specific shutdown function... */
|
||||||
_DOWN();
|
_DOWN();
|
||||||
|
|
||||||
auth = NULL;
|
auth = NULL;
|
||||||
first_dev = NULL;
|
first_dev = NULL;
|
||||||
first_handle = NULL;
|
first_handle = NULL;
|
||||||
|
devlist = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*.............................................................................
|
/*.............................................................................
|
||||||
|
@ -849,9 +856,8 @@ void sane_exit( void )
|
||||||
SANE_Status sane_get_devices(const SANE_Device ***device_list,
|
SANE_Status sane_get_devices(const SANE_Device ***device_list,
|
||||||
SANE_Bool local_only )
|
SANE_Bool local_only )
|
||||||
{
|
{
|
||||||
static const SANE_Device **devlist = 0;
|
Plustek_Device *dev;
|
||||||
Plustek_Device *dev;
|
int i;
|
||||||
int i;
|
|
||||||
|
|
||||||
DBG(_DBG_SANE_INIT, "sane_get_devices (%p, %ld)\n",
|
DBG(_DBG_SANE_INIT, "sane_get_devices (%p, %ld)\n",
|
||||||
device_list, (long) local_only);
|
device_list, (long) local_only);
|
||||||
|
|
Ładowanie…
Reference in New Issue