[PATCH] loadparm: Remove an unneeded variable

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Feb 18 07:18:47 UTC 2016


Hi!

Review appreciated!

Thanks, Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 6430a2f05bae302e42cfb99decc1ea5e9611c3ba Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 18 Feb 2016 08:16:20 +0100
Subject: [PATCH] loadparm: Remove an unneeded variable

When reviewing the patch for bug 11740 I found that the definition of
"num_to_alloc" was not part of the patch text, I had to look it up
in context. Unnecessary I believe.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/param/loadparm.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 50b29e3..1f8e578 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1372,7 +1372,6 @@ static void free_service_byindex(int idx)
 static int add_a_service(const struct loadparm_service *pservice, const char *name)
 {
 	int i;
-	int num_to_alloc = iNumServices + 1;
 	struct loadparm_service **tsp = NULL;
 
 	/* it might already exist */
@@ -1393,7 +1392,7 @@ static int add_a_service(const struct loadparm_service *pservice, const char *na
 		/* if not, then create one */
 		tsp = talloc_realloc(NULL, ServicePtrs,
 				     struct loadparm_service *,
-				     num_to_alloc);
+				     iNumServices + 1);
 		if (tsp == NULL) {
 			DEBUG(0, ("add_a_service: failed to enlarge "
 				  "ServicePtrs!\n"));
-- 
1.7.9.5



More information about the samba-technical mailing list