fixed memory leaks
git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@2555 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
This commit is contained in:
parent
05ee405772
commit
8aadd27e3c
1 changed files with 5 additions and 1 deletions
|
@ -135,6 +135,7 @@ ResponseCode::type LSMServerHandler::
|
|||
insert(datatuple* tuple)
|
||||
{
|
||||
ltable_->insertTuple(tuple);
|
||||
datatuple::freetuple(tuple);
|
||||
return sherpa::ResponseCode::Ok;
|
||||
}
|
||||
|
||||
|
@ -292,7 +293,9 @@ datatuple* LSMServerHandler::
|
|||
get(uint32_t databaseId, const std::string& recordName)
|
||||
{
|
||||
datatuple* recordKey = buildTuple(databaseId, recordName);
|
||||
return get(recordKey);
|
||||
datatuple* ret = get(recordKey);
|
||||
datatuple::freetuple(recordKey);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ResponseCode::type LSMServerHandler::
|
||||
|
@ -390,5 +393,6 @@ buildTuple(uint32_t databaseId, const std::string& recordName, const void* body,
|
|||
*(uint32_t*)key = htonl(databaseId);
|
||||
memcpy(((uint32_t*)key) + 1, recordName.c_str(), recordName.size());
|
||||
datatuple *tup = datatuple::create(key, keySize, body, bodySize);
|
||||
free(key);
|
||||
return tup;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue