[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible memory leak in lowercase() function
[Thread Prev] | [Thread Next]
- Subject: Re: Possible memory leak in lowercase() function
- From: Andreas Schneider <mail@xxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Thu, 10 Sep 2009 19:06:04 +0200
- To: krivenok@xxxxxxxxxxxxxxx
- Cc: Keisial <keisial@xxxxxxxxx>, libssh@xxxxxxxxxx
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.
Possible memory leak in lowercase() function | "Dmitry V. Krivenok" <krivenok@xxxxxxxxxxxxxxx> |
Re: Possible memory leak in lowercase() function | "Dmitry V. Krivenok" <krivenok@xxxxxxxxxxxxxxx> |