LCDproc development and user support list

Text archives Help


[Lcdproc] [Fwd: Re: PATCH: Memory leak in PicoLCD driver]


Chronological Thread 
  • From: jack at jackpot.uk.net (Jack Cleaver)
  • Subject: [Lcdproc] [Fwd: Re: PATCH: Memory leak in PicoLCD driver]
  • Date: Wed, 17 Sep 2008 13:07:16 +0100

Aieee! I originally sent this just to Peter by mistake; it should have
gone to the list, of course.

Peter Marschall wrote:
> Hi,
>
> please keep replies to the list.
>
> On Tuesday, 16. September 2008, you wrote:
>> Peter Marschall wrote:
>>> On Monday, 1. September 2008, Jack Cleaver wrote:
>>>> I'm offering the attached patch for the picoLCD driver.
>>>>
>>>> [ ... ]
>>> retval is only used on initialization, and on assignment from
>>> keystr. It is not returned either. What is it good for ?
>> As I said, my C is rusty, so perhaps I have misunderstood you.
>> However it seems clear to me that retval is indeed returned, at the
>> last statement in the function. It returns a pointer to the value
>> from the key_matrix that had been assigned to keystr.
>>
>>> With your solution the function returns NULL all the time
>>> indicating that no key was pressed. I guess this is not what you
>>> intended.
>> If I insert a debug line immediately before the return statement
>> (conditional on retval not being NULL), then press the Up button,
>> it shows that "Up" is being returned.
>>
>
> Oops, I overlook the final "return retval" line in your original
> patch. (The classical diff output format is really hard to read)
>
> but even then, I think it only adds a variable that is used for the
> same purpose as keystr.
>
> That's why I prefer to leave this patch out.
>
> O.K.?

After looking more closely I now understand your objection, and I hope
this patch is better. There is no new variable this time, and the fix
for the leak is simpler and cleaner. I made the diff against a fresh
copy of the 0.5.2 code taken from sourceforge.

--
Jack.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: picolcd.c.diff
URL:
<http://lists.omnipotent.net/pipermail/lcdproc/attachments/20080917/323019a5/attachment.txt>




Archive powered by MHonArc 2.6.18.

Top of page