[sane-devel] [patch] scanimage leaks memory in batch mode

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Thu Jun 30 06:55:42 UTC 2011


Hi all,

Just noticed that scanimage leaks buffer_size bytes per scan when used
in batch mode.  By default, that's 32 kb.  When using the buffer-size
option it's 1Mb or whatever size you passed.

Patch is attached.  It moves the memory allocation out of scan_it() and
into main(), just before where the non-test-mode branch starts the batch
loop.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scanimage-batch-mode-memory-leak.patch
Type: text/x-diff
Size: 500 bytes
Desc: Fix memory leak in scanimage's batch mode
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20110630/4637dd69/attachment.patch>


More information about the sane-devel mailing list