The previous fix (5e6e3be3) left a possibility to use-after-delete,
though it has been much harder to accidentally trigger.

If AddChan(pChan) fails, it deletes pChan, so the new crash was
happening during showing of error message.

Test for this is at master branch: 9777a1a667

Thanks to https://scan.coverity.com/ for pointing at this.
This commit is contained in:
Alexey Sokolov committed 2015-10-30 01:16:29 +00:00
1 parent 0022fc6162
commit f6aa35c6fb
1 file changed
+1 -1
+1 -1
View File
@@ -707,7 +707,7 @@ public:
}
if (!pNetwork->AddChan(pChan)) {
WebSock.PrintErrorPage("Could not add channel [" + pChan->GetName() + "]");
WebSock.PrintErrorPage("Could not add channel [" + sChanName + "]");
return true;
}
}