Fixed memory leak.

This commit is contained in:
Armin Novak 2014-11-17 00:07:58 +01:00
parent d2952d1776
commit 54224d4155
1 changed files with 7 additions and 0 deletions

View File

@ -511,7 +511,10 @@ wLog* WLog_New(LPCSTR name, wLog* rootLogger)
log->Name = _strdup(name);
if (!log->Name)
{
free (log);
return NULL;
}
WLog_ParseName(log, name);
log->Parent = rootLogger;
@ -520,7 +523,11 @@ wLog* WLog_New(LPCSTR name, wLog* rootLogger)
log->Children = (wLog**) calloc(log->ChildrenSize, sizeof(wLog*));
if (!log->Children)
{
free (log->Name);
free (log);
return NULL;
}
log->Appender = NULL;