[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible memory leak in lowercase() function


On Thursday 10 September 2009 16:49:31 Dmitry V. Krivenok wrote:
> Yes, you are right. It's a potential crash.
> Indeed, memory leak it really unlikely it such a case.
> 
> However, man 3 strdup says nothing about passing NULL as argument
> to strdup, so it's undefined behavior.
> 
> Anyway str should be checked _before_ calling strdup.
> 

Normally an internal function should crash if a NULL pointer is passed. Then 
it is a bug and should be fixed. Only external functions should check for NULL 
arguments.

	-- andreas

Attachment: signature.asc
Description: This is a digitally signed message part.


References:
Possible memory leak in lowercase() function"Dmitry V. Krivenok" <krivenok@xxxxxxxxxxxxxxx>
Re: Possible memory leak in lowercase() function"Dmitry V. Krivenok" <krivenok@xxxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org