From patchwork Tue Jan 8 17:30:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 210461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "aserp1040.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8481E2C0085 for ; Wed, 9 Jan 2013 04:31:01 +1100 (EST) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id r08HUwlh010660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Jan 2013 17:30:58 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r08HUvjF014950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Jan 2013 17:30:58 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Tsd0r-0001Mb-Pn; Tue, 08 Jan 2013 09:30:57 -0800 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Tsd0q-0001MT-So for fedfs-utils-devel@oss.oracle.com; Tue, 08 Jan 2013 09:30:56 -0800 Received: from userp1030.oracle.com (userp1030.oracle.com [156.151.31.80]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r08HUux0015039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 8 Jan 2013 17:30:56 GMT Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) by userp1030.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id r08HUt4g021886 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 8 Jan 2013 17:30:55 GMT Received: by mail-ie0-f171.google.com with SMTP id 17so845712iea.2 for ; Tue, 08 Jan 2013 09:30:55 -0800 (PST) X-Received: by 10.50.149.196 with SMTP id uc4mr9970091igb.74.1357666255250; Tue, 08 Jan 2013 09:30:55 -0800 (PST) Received: from seurat.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id v12sm11152508igv.3.2013.01.08.09.30.54 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 09:30:54 -0800 (PST) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Tue, 08 Jan 2013 12:30:54 -0500 Message-ID: <20130108173053.65331.6625.stgit@seurat.1015granger.net> In-Reply-To: <20130108173026.65331.51229.stgit@seurat.1015granger.net> References: <20130108173026.65331.51229.stgit@seurat.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Flow-Control-Info: class=Default reputation=ipRepBelow100 ip=209.85.223.171 ct-class=R5 ct-vol1=-81 ct-vol2=8 ct-vol3=8 ct-risk=52 ct-spam1=84 ct-spam2=7 ct-bulk=6 rcpts=1 size=960 X-MM-CT-Classification: not spam X-MM-CT-RefID: str=0001.0A090203.50EC57D0.0014,ss=1,re=0.000,fgs=0 Subject: [fedfs-utils] [PATCH 4/4] fedfsd: Fix memory leak in fedfsd_svc_get_limited_nsdb_params_1() X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] If the requested NSDB is not in the server's NSDB database, the buffer containing the NSDB's hostname is leaked. Introduced by commit 0520ee72 "Initial commit" Tue Mar 29 15:37:40 2011. Signed-off-by: Chuck Lever --- src/fedfsd/svc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fedfsd/svc.c b/src/fedfsd/svc.c index 93b110b..9132177 100644 --- a/src/fedfsd/svc.c +++ b/src/fedfsd/svc.c @@ -1111,9 +1111,7 @@ fedfsd_svc_get_limited_nsdb_params_1(SVCXPRT *xprt) xlog(L_WARNING, "Unrecognized NSDB connection security " "type for %s:%u", hostname, port); } - nsdb_free_nsdb(host); - free(hostname); out: xlog(D_CALL, "%s: Replying with %s", @@ -1126,6 +1124,8 @@ out: if (!svc_freeargs(xprt, (xdrproc_t)xdr_FedFsNsdbName, (caddr_t)&args)) xlog(L_WARNING, "Failed to free GET_LIMITED_NSDB_PARAMS arguments"); + + free(hostname); } /**