[PATCH] Make loadparm more common

Andreas Schneider asn at samba.org
Tue Apr 1 02:06:13 MDT 2014


On Tuesday 01 April 2014 17:21:02 you wrote:
> At this point, what I would like to see is these patches reviewed:
> http://git.catalyst.net.nz/gitweb?p=samba.git;a=commitdiff;h=5fa1a3cd62e0dce
> fc5364f83046db025fc0e65b9

-       if ((iTemp = getservicebyname(pszParmValue, &serviceTemp)) >= 0) {
+       if ((iTemp = getservicebyname(pszParmValue, serviceTemp)) >= 0) {

Please split up those lines in two:

	iTemp = getservicebyname(pszParmValue, serviceTemp)
	if (iTemp >= 0) {


> http://git.catalyst.net.nz/gitweb?p=samba.git;a=commitdiff;h=909fb5a6c7df2e
> 2cc7e48d5814eb2cff53ee6664

The change is ok, but if the context is already a talloc pool why not get rid 
of string_init() completely and use always talloc_strdup()?


> http://git.catalyst.net.nz/gitweb?p=samba.git;a=commitdiff;h=5c9f5892c4e330
> 4e2e3f11be0a41d087f9df6d9c

I think here you should allocate with talloc directly on the Globals.ctx and 
not do it on talloc_tos(). string_init() dupclicates the memory and then you 
free it.

> http://git.catalyst.net.nz/gitweb?p=samba.git;a=commitdiff;h=746cbfcd93c38e
> 5bb66e892fa2ef0d0d11888703

This one looks fine.



	-- andreas


-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list