diff --git a/lib/AsyncHttpClient/src/HttpResponse.cpp b/lib/AsyncHttpClient/src/HttpResponse.cpp index 0125a0ec..4e1925b2 100644 --- a/lib/AsyncHttpClient/src/HttpResponse.cpp +++ b/lib/AsyncHttpClient/src/HttpResponse.cpp @@ -69,10 +69,7 @@ HttpResponse& HttpResponse::operator=(const HttpResponse& rsp) m_statusCode = rsp.m_statusCode; m_reasonPhrase = rsp.m_reasonPhrase; - if (nullptr != m_payload) - { - delete[] m_payload; - } + clearPayload(); if (nullptr != rsp.m_payload) { @@ -91,6 +88,8 @@ HttpResponse& HttpResponse::operator=(const HttpResponse& rsp) } } + clearHeaders(); + if (true == it.first()) { do