From patchwork Sun Feb 6 19:58:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 535851 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p16JwOrB029284 for ; Sun, 6 Feb 2011 19:58:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753679Ab1BFT6V (ORCPT ); Sun, 6 Feb 2011 14:58:21 -0500 Received: from mail-bw0-f46.google.com ([209.85.214.46]:35743 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753367Ab1BFT6V (ORCPT ); Sun, 6 Feb 2011 14:58:21 -0500 Received: by bwz15 with SMTP id 15so4325454bwz.19 for ; Sun, 06 Feb 2011 11:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=aYyS7Hb2o44eC1yaWAVahxyYesqJrvzHKq1tldhghVc=; b=WTDeB8kXk7sjHsgf2bO98Lx2KT6pAilOzQhTy5eQCjvb0SgRHWncLl8FZIB6rmzR4p JB3Fz0RpZ9cmrVTBTy6QjGPgfvbt7rAnQ7NZgTzFobrq6T9zmg2ckI571xMlpqm+p/+h 65/wexQbRiUPP8V8oM9f7K4XEfNcnGu01eGVM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=qWMmaz8Zqf5oJXItsaWC4sy/rrgGbkxy6Bs3VWf7u7PAXJ7szfZGYtqD+xtt7P402x wTBTAAdSI+WDRFwiNAzIzaSeZ7x1uNkN3n4qeIEOwuUXYbhhSuFOkN2RXU1KvBNHFVcl noGCjD8NuROp0K178aWpZHAupUlv3MVbK0D5o= Received: by 10.204.72.207 with SMTP id n15mr4072185bkj.62.1297022300089; Sun, 06 Feb 2011 11:58:20 -0800 (PST) Received: from localhost ([46.35.254.12]) by mx.google.com with ESMTPS id 12sm1613005bki.7.2011.02.06.11.58.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Feb 2011 11:58:18 -0800 (PST) Date: Sun, 6 Feb 2011 21:58:21 +0200 From: Ilya Dryomov To: linux-btrfs@vger.kernel.org Cc: Chris Mason Subject: [PATCH] Btrfs - Fix memory leak in btrfs_init_new_device() Message-ID: <20110206195821.GA14978@kwango.lan.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 06 Feb 2011 19:58:25 +0000 (UTC) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d158530..9649cdd 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1601,6 +1601,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) ret = find_next_devid(root, &device->devid); if (ret) { + kfree(device->name); kfree(device); goto error; }