Fixed memory leak.

git-svn-id: http://yate.null.ro/svn/yate/trunk@4701 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2011-11-15 14:37:15 +00:00
parent 0f4f179159
commit 4e0146819b
1 changed files with 4 additions and 6 deletions

View File

@ -183,14 +183,12 @@ bool RegistHandler::received(Message &msg)
Lock lock(s_mutex);
int expire = msg.getIntValue("expires",0);
NamedList* sect = s_cfg.getSection(username);
if (s_create && !sect) {
sect = new NamedList(username);
if (!sect) {
if (!s_create)
return false;
Debug(&__plugin,DebugInfo,"Auto creating new user %s",username.c_str());
}
if (!sect)
return false;
s_accounts.createSection(*sect);
NamedList* s = s_accounts.getSection(*sect);
NamedList* s = s_accounts.createSection(username);
if (driver)
s->setParam("driver",driver);
s->setParam("data",data);