From 494fbe9ce595b0b59597bd426cc3bc4d14ba6644 Mon Sep 17 00:00:00 2001 From: weiqiaomiao Date: Mon, 27 Jun 2016 19:40:13 +0800 Subject: [PATCH] rgw: should delete in_stream_req if conn->get_obj(...) return not zero value Signed-off-by: weiqiaomiao --- src/rgw/rgw_rest_conn.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc index ead41394f47..509df4ee280 100644 --- a/src/rgw/rgw_rest_conn.cc +++ b/src/rgw/rgw_rest_conn.cc @@ -163,7 +163,13 @@ int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, rgw set_header(mod_pg_ver, extra_headers, "HTTP_DEST_PG_VER"); } - return (*req)->get_obj(key, extra_headers, obj); + int r = (*req)->get_obj(key, extra_headers, obj); + if (r < 0) { + delete *req; + *req = nullptr; + } + + return r; } int RGWRESTConn::complete_request(RGWRESTStreamReadRequest *req, string& etag, real_time *mtime, map& attrs) -- 2.47.3