add: safe memory free

This commit is contained in:
Talyx
2022-02-20 14:47:24 +03:00
parent 5c2888190c
commit 0f74c88af6
3 changed files with 19 additions and 4 deletions

View File

@@ -16,8 +16,15 @@ Response::Response()
void Response::freeData(void)
{
if (_body != NULL)
{
delete _body;
delete _header;
_body = NULL;
}
else if (_header != NULL)
{
delete _header;
_header = NULL;
}
}
std::string Response::getHeader(void)