aboutsummaryrefslogtreecommitdiff
path: root/contrib/native/client/src
diff options
context:
space:
mode:
authorLaurent Goujon <laurent@dremio.com>2017-03-20 10:55:17 -0700
committerJinfeng Ni <jni@apache.org>2017-03-31 15:32:06 -0700
commit0ded1d08297cf56c8e38f98a8c1cf3708c3a584c (patch)
treee60f06da59bc4698a29602b5acf14f4e458db9dd /contrib/native/client/src
parentb82177ed612edd0e33ac1d5500a7dd65953c8c1d (diff)
DRILL-5368: Fix memory leak issue in DrillClientImpl::processServerMetaResult
Fix a small memory leak by doing local allocation instead since the object doesn't escape the function. close #790
Diffstat (limited to 'contrib/native/client/src')
-rw-r--r--contrib/native/client/src/clientlib/drillClientImpl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.cpp b/contrib/native/client/src/clientlib/drillClientImpl.cpp
index 7e169e9ab..30a354e47 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.cpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp
@@ -1364,15 +1364,15 @@ status_t DrillClientImpl::processServerMetaResult(AllocatedBufferPtr allocatedBu
std::map<int,DrillClientQueryHandle*>::const_iterator it=this->m_queryHandles.find(msg.m_coord_id);
if(it!=this->m_queryHandles.end()){
DrillClientServerMetaHandle* pHandle=static_cast<DrillClientServerMetaHandle*>((*it).second);
- exec::user::GetServerMetaResp* resp = new exec::user::GetServerMetaResp();
DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Received GetServerMetaResp result Handle " << msg.m_pbody.size() << std::endl;)
- if (!(resp->ParseFromArray(msg.m_pbody.data(), msg.m_pbody.size()))) {
+ exec::user::GetServerMetaResp resp;
+ if (!(resp.ParseFromArray(msg.m_pbody.data(), msg.m_pbody.size()))) {
return handleQryError(QRY_COMM_ERROR, "Cannot decode GetServerMetaResp results", pHandle);
}
- if (resp->status() != exec::user::OK) {
- return handleQryError(QRY_FAILED, resp->error(), pHandle);
+ if (resp.status() != exec::user::OK) {
+ return handleQryError(QRY_FAILED, resp.error(), pHandle);
}
- pHandle->notifyListener(&(resp->server_meta()), NULL);
+ pHandle->notifyListener(&(resp.server_meta()), NULL);
DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "GetServerMetaResp result " << std::endl;)
}else{
return handleQryError(QRY_INTERNAL_ERROR, getMessage(ERR_QRY_INVQUERYID), NULL);