From patchwork Sat Jan 8 18:24:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 77975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ECC64B7140 for ; Sun, 9 Jan 2011 05:32:16 +1100 (EST) Received: from localhost ([127.0.0.1]:55768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbdaH-0001ue-8m for incoming@patchwork.ozlabs.org; Sat, 08 Jan 2011 13:32:13 -0500 Received: from [140.186.70.92] (port=46234 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbdTG-0006PH-5q for qemu-devel@nongnu.org; Sat, 08 Jan 2011 13:24:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbdTB-0006wE-B7 for qemu-devel@nongnu.org; Sat, 08 Jan 2011 13:24:58 -0500 Received: from mail-pv0-f173.google.com ([74.125.83.173]:44472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbdTB-0006w9-37 for qemu-devel@nongnu.org; Sat, 08 Jan 2011 13:24:53 -0500 Received: by pvh11 with SMTP id 11so4258015pvh.4 for ; Sat, 08 Jan 2011 10:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=Ake0bkU0hN1CjL7JHYd9K0uyniz74QYCYeSw00wMrCQ=; b=hDY5vLtDa/BEiNMC4f/FbzQ43wAuHyTdnQ4NfvICGASJb4e6u2mkzDwdfMBqxm1p9q aCNmq4f2oVPsFYm/I4UlpeN5q7SZUdU9Da7Jv0fypfl4BL6QBYu1dK7exqdrnGpN7Id0 TBKNMChQA71OtUEg/RjIzjoJWCh0yTRIkR+58= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=qjwU7Oum1QFg7y+r3GU35xUCL+yQYbTBZWgkp+Wg4ZIOwzBOw8J+3DN6hGSTPvY99m UKdIYTptPGoDXEPDlaEYzksVZvthoenKN0VhT4OkExmd0jYWnmsQxVOhbOlxKHOFKImA 8qiMOhG+RR/zEX6fFyGTwr+CcprrzFjavKBUo= Received: by 10.142.156.15 with SMTP id d15mr2773056wfe.287.1294511092328; Sat, 08 Jan 2011 10:24:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.241.1 with HTTP; Sat, 8 Jan 2011 10:24:32 -0800 (PST) From: Blue Swirl Date: Sat, 8 Jan 2011 18:24:32 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 3/7] vvfat: fix a file descriptor leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fix a file descriptor leak, reported by cppcheck: [/src/qemu/block/vvfat.c:759]: (error) Resource leak: dir Signed-off-by: Blue Swirl --- block/vvfat.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) direntry->size=cpu_to_le32(S_ISDIR(st.st_mode)?0:st.st_size); diff --git a/block/vvfat.c b/block/vvfat.c index 26dd474..fe568fe 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -756,6 +756,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index) if (st.st_size > 0x7fffffff) { fprintf(stderr, "File %s is larger than 2GB\n", buffer); free(buffer); + closedir(dir); return -2; }