Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2014 20:41:09 +0000 (UTC)
From:      Christian Brueffer <brueffer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265238 - head/lib/libc/rpc
Message-ID:  <201405022041.s42Kf93I043111@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brueffer
Date: Fri May  2 20:41:09 2014
New Revision: 265238
URL: http://svnweb.freebsd.org/changeset/base/265238

Log:
  Properly free resources in case of error.
  
  CID:		1007032
  Found with:	Coverity Prevent(tm)
  MFC after:	2 weeks

Modified:
  head/lib/libc/rpc/clnt_vc.c

Modified: head/lib/libc/rpc/clnt_vc.c
==============================================================================
--- head/lib/libc/rpc/clnt_vc.c	Fri May  2 20:36:20 2014	(r265237)
+++ head/lib/libc/rpc/clnt_vc.c	Fri May  2 20:41:09 2014	(r265238)
@@ -301,15 +301,13 @@ clnt_vc_create(fd, raddr, prog, vers, se
 	return (cl);
 
 err:
-	if (cl) {
-		if (ct) {
-			if (ct->ct_addr.len)
-				mem_free(ct->ct_addr.buf, ct->ct_addr.len);
-			mem_free(ct, sizeof (struct ct_data));
-		}
-		if (cl)
-			mem_free(cl, sizeof (CLIENT));
+	if (ct) {
+		if (ct->ct_addr.len)
+			mem_free(ct->ct_addr.buf, ct->ct_addr.len);
+		mem_free(ct, sizeof (struct ct_data));
 	}
+	if (cl)
+		mem_free(cl, sizeof (CLIENT));
 	return ((CLIENT *)NULL);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405022041.s42Kf93I043111>