From patchwork Thu Dec 1 12:27:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Meyering X-Patchwork-Id: 128694 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 70C70B6F7B for ; Thu, 1 Dec 2011 23:27:41 +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 pB1CRZxS026396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Dec 2011 12:27:36 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 pB1CRZvk027239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Dec 2011 12:27:35 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1RW5je-0004t3-5Y; Thu, 01 Dec 2011 04:27:30 -0800 Received: from rcsinet12.oracle.com ([148.87.113.124]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1RW5jc-0004sN-Dn for fedfs-utils-devel@oss.oracle.com; Thu, 01 Dec 2011 04:27:28 -0800 Received: from mx.meyering.net (mx.meyering.net [88.168.87.75]) by rcsinet12.oracle.com (Sentrion-MTA-4.2.0/Sentrion-MTA-4.2.0) with ESMTP id pB1CRQlw023926 for ; Thu, 1 Dec 2011 12:27:27 GMT Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 1257460632; Thu, 1 Dec 2011 13:27:24 +0100 (CET) From: Jim Meyering To: fedfs-utils-devel@oss.oracle.com Date: Thu, 1 Dec 2011 13:27:18 +0100 Message-Id: <1322742439-2171-8-git-send-email-jim@meyering.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1322742439-2171-1-git-send-email-jim@meyering.net> References: <1322742439-2171-1-git-send-email-jim@meyering.net> Subject: [fedfs-utils] [PATCH v2 7/8] 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: , MIME-Version: 1.0 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.0A090208.4ED772B8.0087: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. 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; }