Skip to content

Commit

Permalink
bad fork of twemcache, fix memory leak (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
slyphon authored Jul 5, 2018
1 parent 6fd0c34 commit 3a0efc3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/server/cdb/data/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,16 @@ cdb_process_read(struct buf **rbuf, struct buf **wbuf, void **data)
log_verb("post-read processing");

/* deal with the stateful part: request and response */
req = (*data != NULL) ? *data : request_borrow();
if (req == NULL) {
/* TODO(yao): simply return for now, better to respond with OOM */
log_error("cannot process request: OOM");
INCR(process_metrics, process_ex);
req = *data;
if (req == NULL) {
req = *data = request_borrow();
if (req == NULL) {
/* TODO(yao): simply return for now, better to respond with OOM */
log_error("cannot process request: OOM");
INCR(process_metrics, process_ex);

return -1;
return -1;
}
}
rsp = (req->rsp != NULL) ? req->rsp : response_borrow();
if (rsp == NULL) {
Expand Down

0 comments on commit 3a0efc3

Please sign in to comment.