Fix two use-after-free bugs.

This commit is contained in:
Jon Siwek 2013-09-10 13:30:23 -05:00
parent ee1312f2ad
commit 1fbeefedbc
2 changed files with 3 additions and 2 deletions

View file

@ -402,10 +402,11 @@ bool Manager::RemoveStream(EnumVal* id)
}
stream->writers.clear();
string sname(stream->name);
delete stream;
streams[idx] = 0;
DBG_LOG(DBG_LOGGING, "Removed logging stream '%s'", stream->name.c_str());
DBG_LOG(DBG_LOGGING, "Removed logging stream '%s'", sname.c_str());
return true;
}