[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: "Dmitry V. Krivenok" <krivenok@xxxxxxxxxxxxxxx>
- Reply-to: krivenok@xxxxxxxxxxxxxxx
- Reply-to: libssh@xxxxxxxxxx
- Date: Thu, 10 Sep 2009 18:49:31 +0400
- To: Keisial <keisial@xxxxxxxxx>
- Cc: libssh@xxxxxxxxxx
Keisial wrote:
Dmitry V. Krivenok escribió:Hello! I fixed a bug in lowercase(). Patch is attached.This wasn't a memory leak, but a potential crash. Some (most?) strdup() implementations segfault when calling strdup(NULL);
Hello! 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. -- Sincerely yours, Dmitry V. Krivenok Orange System Co., Ltd. Saint-Petersburg, Russia work phone: +7 812 332-32-40 cellular phone: +7 921 576-70-91 e-mail: krivenok@xxxxxxxxxxxxxxx web: http://www.orangesystem.ru skype: krivenok_dmitry jabber: krivenok_dmitry@xxxxxxxxx icq: 242-526-443
Re: Possible memory leak in lowercase() function | Andreas Schneider <mail@xxxxxxxxxxxx> |
Possible memory leak in lowercase() function | "Dmitry V. Krivenok" <krivenok@xxxxxxxxxxxxxxx> |