[Lcdproc] PATCH: Memory leak in PicoLCD driver

Jack Cleaver jack at jackpot.uk.net
Wed Sep 17 02:08:22 CST 2008


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.?

I wonder if perhaps I have generated the diff against the wrong version
of the source; or perhaps in some other respect, my inexperience has
resulted in you seeing different code from me?

I think I'll try again to make this change against a new version of the
source, and produce a new diff using the approved flags.

-- 
Jack.


More information about the LCDproc mailing list