In the unusual event that the GopherStateData object constructor fails
it is possible that the destructor gets called without having gone
through the deleteThis() and swangSong() dance. Since the constructor
allocates memory buffer we need to clean that up.
Detected by Coverity Scan. Issue
1318022
entry->lock("gopherState");
*replybuf = 0;
}
+ ~GopherStateData() {if(buf) swanSong();}
/* AsyncJob API emulated */
void deleteThis(const char *aReason);
if (entry)
entry->unlock("gopherState");
- if (buf)
+ if (buf) {
memFree(buf, MEM_4K_BUF);
+ buf = nullptr;
+ }
}
/**