From patchwork Tue Aug 20 15:43:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2847161 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@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 608D99F271 for ; Tue, 20 Aug 2013 15:43:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 384562050E for ; Tue, 20 Aug 2013 15:43:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E2652050B for ; Tue, 20 Aug 2013 15:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751718Ab3HTPnh (ORCPT ); Tue, 20 Aug 2013 11:43:37 -0400 Received: from mail-gh0-f182.google.com ([209.85.160.182]:47435 "EHLO mail-gh0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751715Ab3HTPnf (ORCPT ); Tue, 20 Aug 2013 11:43:35 -0400 Received: by mail-gh0-f182.google.com with SMTP id z15so118394ghb.41 for ; Tue, 20 Aug 2013 08:43:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=XCDh3atgvnQ+ylM4i4Eq/qoJmOxSY+4oXkSPlSs/xsw=; b=phS5YHwGF3LlkQBaQU6sXZQBKcwyuMK2/cfcJrtEBMWxEyRdeWOO7UbLgXERcxV7uI wclUjrsZLMp/UvqdEs47lmbWX1LmFJ7HRoPxU6l3uib6jUz60XA3bBITzobV1b7r5Cdl yzA5mwJRAkgK8yyN2cs/gqwmmWmyLwG+xqfvCuwF5swoM8tKORZxHXr/yslmujHN62kf wsS+dRrSvfmxJUvgJRquUJiTAOrmyQRfEQE0Ka7bA3RW+N6S7JBCE4ng33gi7TIcQEpk 3Y3/yG9N1JrcdbXwrzsZ9C90s2gQnOpuQ0iZ3PdcUNrBz6/aR61VxVw7mM7h64ZZRIlD mqcA== X-Gm-Message-State: ALoCoQmJua3WG/S21XXrhTHtslBcyy7zpTE+/uT/XGeouIqkoxJtbPuVLr2fkz9HK4bojENk9yxd X-Received: by 10.236.129.37 with SMTP id g25mr825652yhi.121.1377013415281; Tue, 20 Aug 2013 08:43:35 -0700 (PDT) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id c7sm2147254yhk.23.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Aug 2013 08:43:34 -0700 (PDT) Message-ID: <52138EA4.7080505@dev.mellanox.co.il> Date: Tue, 20 Aug 2013 11:43:32 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Alex Netes Subject: [PATCH opensm] osm_db_files.c: Fix memory leak when deleting entries from osm db Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-9.7 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 From: Alex Netes The key also should be freed. Signed-off-by: Alex Netes Signed-off-by: Hal Rosenstock --- opensm/osm_db_files.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/opensm/osm_db_files.c b/opensm/osm_db_files.c index 94dc11c..0eef1d4 100644 --- a/opensm/osm_db_files.c +++ b/opensm/osm_db_files.c @@ -608,6 +608,7 @@ int osm_db_delete(IN osm_db_domain_t * p_domain, IN char *p_key) p_key, p_domain_imp->file_name, p_prev_val); res = 1; } else { + free(p_key); free(p_prev_val); res = 0; }