[PATCH libSM] Fix some potential memory leaks in SmcCloseConnection().

Kim Woelders kim at woelders.dk
Sat Nov 27 07:00:12 PST 2010


On Sat, 27 Nov 2010 05:10:15 +0100, Corbin Simpson  
<mostawesomedude at gmail.com> wrote:

> On Fri, Nov 26, 2010 at 4:34 PM, Jesse Adkins <jesserayadkins at gmail.com>  
> wrote:
>> I had to backspace after the 'char' and before '**reasonMsgs' to get
>> this to apply. Perhaps the git repo has been updated since this patch.
>> Aside from that, it applies.
>>
Some mailer issue? The source file hasn't been changed since Jan 2009.
I have no problems git am'ing my e-mail.

>> Can you comment on why this is needed, either in the code or in the
>> git commit? Is there anything that can be done to trigger this leak? I
>> have no problem with giving this a test, but I've never heard of a
>> leak in libSM when running X in valgrind mode or using it on clients.
>>
I have attached a completely foolish program that triggers both memory  
leaks, and I'm quite certain that they can be triggered in less  
pathological situations.

>
> Is it proper convention to cast arguments to free() as char* in this
> lib? I'd rather just leave it uncasted.
>
So would I, but I considered it more important to maintain the existing  
style.
If "new" style is considered more important I'll send a new patch.

> Shutting up Valgrind is always important, even if the leak in question
> is trivial.
>
> Reviewed-by: Corbin Simpson <MostAwesomeDude at gmail.com>
>
Thanks, added to patch.

/Kim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sm.c
Type: text/x-csrc
Size: 732 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101127/e5e21b1a/attachment.c>


More information about the xorg-devel mailing list