Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2014 20:45:55 +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: r265240 - head/sys/rpc
Message-ID:  <201405022045.s42Kjt9e045901@svn.freebsd.org>

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

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

Modified:
  head/sys/rpc/clnt_vc.c

Modified: head/sys/rpc/clnt_vc.c
==============================================================================
--- head/sys/rpc/clnt_vc.c	Fri May  2 20:45:34 2014	(r265239)
+++ head/sys/rpc/clnt_vc.c	Fri May  2 20:45:55 2014	(r265240)
@@ -270,14 +270,12 @@ clnt_vc_create(
 	return (cl);
 
 err:
-	if (cl) {
-		if (ct) {
-			mtx_destroy(&ct->ct_lock);
-			mem_free(ct, sizeof (struct ct_data));
-		}
-		if (cl)
-			mem_free(cl, sizeof (CLIENT));
+	if (ct) {
+		mtx_destroy(&ct->ct_lock);
+		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?201405022045.s42Kjt9e045901>