The error code must be returned to caller even if the error string is not set.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13577
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit
e4afb211fe32f2aa92cc903df948874046f60305)
WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED;
werr = libnet_Join(j, j);
- if (!W_ERROR_IS_OK(werr) && j->out.error_string) {
- libnetapi_set_error_string(ctx, "%s", j->out.error_string);
+ if (!W_ERROR_IS_OK(werr)) {
+ if (j->out.error_string != NULL) {
+ libnetapi_set_error_string(ctx, "%s", j->out.error_string);
+ }
talloc_free(j);
return werr;
}