Samba 4 libnet_join and RPC-JOIN torture test

Brad Henry j0j0 at riod.ca
Fri Sep 16 03:26:12 GMT 2005


Andrew Bartlett wrote:

>On Tue, 2005-09-13 at 07:36 +0200, Stefan (metze) Metzmacher wrote:
> 
>  
>
>>str = talloc_asprintf(tmp_ctx,"Hello World");
>>NT_STATUS_NO_MEMORY_TMPMEM(str, tmp_ctx);
>>
>>status = libnet_foo(ctx, tmp_ctx, &r);
>>NT_STATUS_NOT_OK_RETURN_TMPMEM(status, tmp_ctx);
>>
>>abartlet: would you be happy with this?
>>(if so I'll add the macros)
>>    
>>
>
>Frankly, macros that 'return' inside them scare me, and put off code
>analysers.
>
>Personally, I would simply prefer the spelled out:
>
>if (failcon) {
>	talloc_free(tmp_ctx);
>	return failed;
>}
>
>Andrew Bartlett
>
>  
>
Here is the patch redone with the goto statements removed and explicit 
error checking throughout. We should try to make life easy for the code 
analyzers after all. :)

How does that look?

Brad

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SAMBA_4_0-join.diff
Type: text/x-patch
Size: 56747 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20050915/8210a59c/SAMBA_4_0-join.bin


More information about the samba-technical mailing list