Review Request 126096: Fix memory leak in kscreen backend of libkscreen

Daniel Vrátil dvratil at kde.org
Tue Nov 17 16:40:19 UTC 2015



> On Nov. 17, 2015, 5:08 p.m., Martin Gräßlin wrote:
> > backends/xrandr/xrandrscreen.cpp, line 67
> > <https://git.reviewboard.kde.org/r/126096/diff/1/?file=417181#file417181line67>
> >
> >     Suggestion QScopedPointer<xcb_blah, QScopedPointerPodDeleter>
> 
> Daniel Vrátil wrote:
>     Yes please, but use XCB::ScopedPointer<xcb_...> from xcbwrapper.h instead.
> 
> Lamarque Souza wrote:
>     Do you think it is safe to delete the pointer returned by xcb_randr_get_screen_resources_current_reply() in XRandR::screenResources()? I seems so, just wondering if this patch can side effects in the "hack" used in XRandR::screenResources().

Yeah, it's fine. Both versions of the reply would be free'd by free(), so there's no danger.


- Daniel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126096/#review88491
-----------------------------------------------------------


On Nov. 17, 2015, 5:31 p.m., Lamarque Souza wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126096/
> -----------------------------------------------------------
> 
> (Updated Nov. 17, 2015, 5:31 p.m.)
> 
> 
> Review request for Plasma, Solid and Daniel Vrátil.
> 
> 
> Repository: libkscreen
> 
> 
> Description
> -------
> 
> libkscreen needs to free memory of xcb_randr_get_screen_resources_reply.
> 
> 
> Diffs
> -----
> 
>   backends/xrandr/xrandrscreen.cpp 8df957e 
> 
> Diff: https://git.reviewboard.kde.org/r/126096/diff/
> 
> 
> Testing
> -------
> 
> No memory leak and everything still works.
> 
> 
> Thanks,
> 
> Lamarque Souza
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20151117/81016633/attachment.html>


More information about the Plasma-devel mailing list