From patchwork Wed Oct 30 13:32:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 3114621 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0EA259F3E2 for ; Wed, 30 Oct 2013 13:32:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E4F02020E for ; Wed, 30 Oct 2013 13:32:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 434E52034D for ; Wed, 30 Oct 2013 13:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753010Ab3J3Ncl (ORCPT ); Wed, 30 Oct 2013 09:32:41 -0400 Received: from m59-178.qiye.163.com ([123.58.178.59]:52867 "EHLO m59-178.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751971Ab3J3Ncl (ORCPT ); Wed, 30 Oct 2013 09:32:41 -0400 Received: from localhost.localdomain (unknown [222.240.177.34]) by m59-178.qiye.163.com (HMail) with ESMTPA id CE31614840B0; Wed, 30 Oct 2013 21:32:38 +0800 (CST) From: Li Wang To: Cc: Sage Weil , Li Wang Subject: [PATCH] ceph: Release resource before return in BackedObject::download() Date: Wed, 30 Oct 2013 21:32:34 +0800 Message-Id: <1383139954-21951-1-git-send-email-liwang@ubuntukylin.com> X-Mailer: git-send-email 1.7.9.5 X-HM-Spam-Status: e1koWUFPN1dZCBgUCR5ZQUpOVUNJQkJCQkJJSExLTUtOTldZCQ4XHghZQV koKz0kKDQ9Lz06MjckMjUkMz46Pz4pQUtVS0A2IyQiPigkMjUkMz46Pz4pQUtVS0ArLykkIj4oJD I1JDM#Oj8#KUFLVUtAODQuNS8pIiQ4NUFLVUtAKT48MjQ1JDooMjpBS1VLQCspNC0yNTg#JDMuNT o1QUtVS0A*IjU6NjI4JDIrJDU0JDI1JDM#Oj8#KUFLVUtAKT46NyQyKyQyNSQpOTckMjUkMz46Pz 4pQUpJVUtANi43LzIkKTgrLyQ*Mj09Pik#NS8kMjUkMz46Pz4pQUlVS0AyKyQvND86IiQ4NS8kSy RKS0tBS1VLQDIrJEokMzQuKSQ4NS8kSyRKS0tBS1VLQDIrJEokNjI1Li8#JDg1LyRLJEpLQUtVS0 AyKyRISyQ2MjUuLz4kODUvJEskTktBS1VLQDIrJE4kNjI1Li8#JDg1LyRLJEpLQUtVS0AoLjkkPk FKVU5OQD01JCguOSQ#NSw0KT8oJDM3MSRKS0tJS0pBS1VJQ1kG X-HM-Sender-Digest: e1kSHx4VD1lBWUc6MQg6Cjo4LDo4EDorKjhIOj4qOkMwCjFVSlVKSENI SkhCQk5CS0lJVTMWGhIXVRcSDBoVHDsOGQ4VDw4QAhcSFVUYFBZFWVdZDB4ZWUEdGhcIHldZCAFZ QUpISUI3V1kSC1lBWUlJSVVJT0tVSkxMVUhPWQY+ Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Close file before return Signed-off-by: Li Wang --- src/tools/rados/rados_sync.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/rados/rados_sync.cc b/src/tools/rados/rados_sync.cc index 03293d3..d2d6ab5 100644 --- a/src/tools/rados/rados_sync.cc +++ b/src/tools/rados/rados_sync.cc @@ -579,6 +579,7 @@ int BackedUpObject::download(IoCtx &io_ctx, const char *path) if (rlen < 0) { cerr << ERR_PREFIX << "download: io_ctx.read(" << rados_name << ") returned " << rlen << std::endl; + fclose(fp); return rlen; } if (rlen < CHUNK_SZ)