From patchwork Mon Dec 5 17:24:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 129381 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "acsinet15.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 6D5AE1007D4 for ; Tue, 6 Dec 2011 04:24:29 +1100 (EST) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pB5HOO5O012673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Dec 2011 17:24:24 GMT Received: from oss.oracle.com (oss.oracle.com [141.146.12.120]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pB5HONFO026140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 Dec 2011 17:24:23 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1RXcH4-0003ht-8u; Mon, 05 Dec 2011 09:24:18 -0800 Received: from acsinet13.oracle.com ([141.146.126.235]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1RXcH2-0003hm-JM for fedfs-utils-devel@oss.oracle.com; Mon, 05 Dec 2011 09:24:16 -0800 Received: from mail-gy0-f171.google.com (mail-gy0-f171.google.com [209.85.160.171]) by acsinet13.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pB5HOE31003873 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Mon, 5 Dec 2011 17:24:16 GMT Received: by ghrr15 with SMTP id r15so2611966ghr.2 for ; Mon, 05 Dec 2011 09:24:14 -0800 (PST) Received: by 10.50.57.138 with SMTP id i10mr11054390igq.3.1323105854660; Mon, 05 Dec 2011 09:24:14 -0800 (PST) Received: from degas.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id mb4sm43740144igc.1.2011.12.05.09.24.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Dec 2011 09:24:14 -0800 (PST) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Mon, 05 Dec 2011 12:24:13 -0500 Message-ID: <20111205172413.7753.52192.stgit@degas.1015granger.net> In-Reply-To: <20111205171929.7753.36203.stgit@degas.1015granger.net> References: <20111205171929.7753.36203.stgit@degas.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Flow-Control-Info: class=ISPs ip=209.85.160.171 ct-class=R6 ct-vol1=0 ct-vol2=0 ct-vol3=0 ct-risk=68 ct-spam1=0 ct-spam2=0 ct-bulk=0 rcpts=1 size=725 Subject: [fedfs-utils] [PATCH 8/9] libsi: don't leak a struct srvinfo upon failed strdup 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] X-CT-RefId: str=0001.0A090202.4EDCFE49.0020:SCFSTAT1119972, ss=1, re=-4.000, fgs=0 X-Auth-Type: Internal IP From: Jim Meyering * src/libsi/getsrvinfo.c (getsrvinfo): Free "new". Spotted by coverity. Introduced in commit 0520ee72: "Initial commit," (March 29, 2011). Signed-off-by: Jim Meyering --- src/libsi/getsrvinfo.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/libsi/getsrvinfo.c b/src/libsi/getsrvinfo.c index 7a465c7..931847e 100644 --- a/src/libsi/getsrvinfo.c +++ b/src/libsi/getsrvinfo.c @@ -289,6 +289,7 @@ getsrvinfo(const char *srvname, const char *domainname, struct srvinfo **si) new->si_target = strdup(exp_dn); if (new->si_target == NULL) { + free(new); status = ESI_MEMORY; goto out; }