From patchwork Wed Feb 3 11:00:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 76685 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o13AulKq004670 for ; Wed, 3 Feb 2010 10:56:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753502Ab0BCK4q (ORCPT ); Wed, 3 Feb 2010 05:56:46 -0500 Received: from mail-fx0-f215.google.com ([209.85.220.215]:48224 "EHLO mail-fx0-f215.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752023Ab0BCK4q (ORCPT ); Wed, 3 Feb 2010 05:56:46 -0500 Received: by fxm7 with SMTP id 7so1345846fxm.28 for ; Wed, 03 Feb 2010 02:56:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :subject:message-id:mime-version:content-type:content-disposition :user-agent; bh=2fCQQZdFj1NMF/niAUHFASK5XBVP/kmbNraEb+kiEmI=; b=D22mJ426L9Z27cuibW34yAJW24LsB8xfSkftxDU8LfsUIWoIxGGmXwVdy7KCvqB3Yz JGCnPYsuV4f6QKbVsmCtPrKd39QVTObVTx2mqjlMIyJ5mT5G3DZQxaITAvAgwDwh1izX glmUbB7Uo0KpEzzEoOV9oAolA8c8RNk6GnwIA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=MLa2+qAJy/yw6mKqxhPDKFNseqohMkydty28wQxxU1Dly+5MJgsFKMEPxcROq7gTJC srMCoOmHmKCCNNdQFyJ4J1HReDimuW9fYl9JulZTqpN62CnbnZeLGvsy3RhETcXUHZsZ sLg+nZ/VV7eMPleJ/z7doVgnS9sDRwbHeJqBg= Received: by 10.223.143.21 with SMTP id s21mr7696133fau.51.1265194603779; Wed, 03 Feb 2010 02:56:43 -0800 (PST) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id 13sm3073474fxm.13.2010.02.03.02.56.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 02:56:43 -0800 (PST) Received: by me.localdomain (Postfix, from userid 1000) id 700D312AF9; Wed, 3 Feb 2010 13:00:22 +0200 (IST) Date: Wed, 3 Feb 2010 13:00:22 +0200 From: Sasha Khapyorsky To: linux-rdma Subject: [PATCH] opensm/osm_mcast_mgr.c: fix memory leak Message-ID: <20100203110022.GA26338@me> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Feb 2010 10:56:47 +0000 (UTC) diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c index dce9f2b..d7267e4 100644 --- a/opensm/opensm/osm_mcast_mgr.c +++ b/opensm/opensm/osm_mcast_mgr.c @@ -549,6 +549,8 @@ static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho, OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A16: " "Unable to allocate list array\n"); mcast_mgr_purge_list(sm, p_list); + osm_mtree_destroy(p_mtn); + p_mtn = NULL; goto Exit; }