Skip to content

Commit

Permalink
rgw: RGWReadRESTResourceCR, fix refcounting
Browse files Browse the repository at this point in the history
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit d1ec31d)
  • Loading branch information
yehudasa committed May 9, 2016
1 parent 93a65f3 commit cbea993
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rgw/rgw_cr_rest.h
Expand Up @@ -39,6 +39,7 @@ class RGWReadRESTResourceCR : public RGWSimpleCoroutine {
if (ret < 0) {
log_error() << "failed to send http operation: " << op->to_str()
<< " ret=" << ret << std::endl;
op->put();
return ret;
}
std::swap(http_op, op); // store reference in http_op on success
Expand All @@ -51,8 +52,10 @@ class RGWReadRESTResourceCR : public RGWSimpleCoroutine {
if (ret < 0) {
error_stream << "http operation failed: " << op->to_str()
<< " status=" << op->get_http_status() << std::endl;
op->put();
return ret;
}
op->put();
return 0;
}

Expand Down

0 comments on commit cbea993

Please sign in to comment.