[sane-devel] Trouble with sanei_usb change (commit ef5820ce6238469b9946b37e21ec5355edfa520a)

Gerhard Jäger gerhard at gjaeger.de
Thu Feb 28 07:14:34 UTC 2013

Hi Stef,

On Thursday 28 February 2013 07:28:55 Stef wrote:
> On 27/02/2013 22:10, Stef wrote:
> > On 27/02/2013 21:59, Stef wrote:
> >> Hello,
> >>
> >>     the ef5820ce6238469b9946b37e21ec5355edfa520a commit is causing me 
> >> troubles.
> >> Should we free devname on close ? We can open/close several times the 
> >> same device, so I think freeing in sanei_usb_close is problematic. 
> >> Reverting this change restored functionality to my backend.

sorry for that - I think I was too fast and remember that ages ago this
was the reason, why we didn't free devname...
>      regarding the memory leak, the following patch takes care of the 
> case where memory is leaked on device that get unplugged or powered off.
>       About the few bytes left when a backend exits, what is really 
> needed is a sanei_usb_exit function. This function would free allocated 
> resources when the last user of sanei_usb_init() calls it.

okay - I'd say, apply the patch and if possible make a proposal for
sanei_usb_exit() or _cleanup().


More information about the sane-devel mailing list