Review Request: Prevent memory leaks when opening a zip store multiple times

Boudewijn Rempt boud at valdyas.org
Thu Oct 7 10:27:04 BST 2010



> On 2010-10-07 07:32:40, Hans Meine wrote:
> > trunk/KDE/kdelibs/kdecore/compression/kbzip2filter.cpp, line 77
> > <http://svn.reviewboard.kde.org/r/5536/diff/2/?file=39031#file39031line77>
> >
> >     wouldn't it make even more sense API-wise to store the mode instead of a bool isInitialized, and check/assert that open is not called with different modes?

I don't really have an opinion on that -- I considered asserts, but I don't know what's the usual thing in kdelibs.


- Boudewijn


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5536/#review8007
-----------------------------------------------------------


On 2010-10-06 14:15:56, Boudewijn Rempt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5536/
> -----------------------------------------------------------
> 
> (Updated 2010-10-06 14:15:56)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> It is possible to accidentally call open() twice. If you do that on a zip store, kgzipfilter will be initialized twice, deflateInit2 will be called twice and we leak memory.
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdelibs/kdecore/compression/kbzip2filter.cpp 1182756 
>   trunk/KDE/kdelibs/kdecore/compression/kfilterdev.cpp 1182756 
>   trunk/KDE/kdelibs/kdecore/compression/kgzipfilter.cpp 1182756 
>   trunk/KDE/kdelibs/kdecore/compression/kxzfilter.cpp 1182756 
> 
> Diff: http://svn.reviewboard.kde.org/r/5536/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Boudewijn
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20101007/48e56be5/attachment.htm>


More information about the kde-core-devel mailing list