Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B8CEF21EA15C5 for ; Thu, 5 Oct 2017 18:52:48 -0700 (PDT) From: Vishal Verma Subject: [ndctl PATCH 1/8] libndctl: fix a memory leak in add_bus Date: Thu, 5 Oct 2017 19:53:58 -0600 Message-Id: <20171006015405.29908-2-vishal.l.verma@intel.com> In-Reply-To: <20171006015405.29908-1-vishal.l.verma@intel.com> References: <20171006015405.29908-1-vishal.l.verma@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: linux-nvdimm@lists.01.org List-ID: We allocated a buffer for wait_probe_path via strdup, but failed to free it in the error path. Cc: Dan Williams Signed-off-by: Vishal Verma --- ndctl/lib/libndctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c index 027842b..60143d9 100644 --- a/ndctl/lib/libndctl.c +++ b/ndctl/lib/libndctl.c @@ -809,6 +809,7 @@ static void *add_bus(void *parent, int id, const char *ctl_base) err_dev_path: err_read: + free(bus->wait_probe_path); free(bus->provider); free(bus->bus_buf); free(bus); -- 2.9.5 _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm