nsswitch: Slightly simplify winbindd_request_response
authorVolker Lendecke <vl@samba.org>
Sat, 15 Jul 2017 09:54:14 +0000 (11:54 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 17 Nov 2017 23:09:16 +0000 (00:09 +0100)
We don't need a separate variable, C passes a copy on the stack

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
nsswitch/wb_common.c

index 262181a3cff2e5a25127e0d86ea667fe5f19fd66..d6746b4f535885623442a70ed8120aba37ea895c 100644 (file)
@@ -719,16 +719,15 @@ NSS_STATUS winbindd_request_response(struct winbindd_context *ctx,
                                     struct winbindd_response *response)
 {
        NSS_STATUS status = NSS_STATUS_UNAVAIL;
                                     struct winbindd_response *response)
 {
        NSS_STATUS status = NSS_STATUS_UNAVAIL;
-       struct winbindd_context *wb_ctx = ctx;
 
        if (ctx == NULL) {
 
        if (ctx == NULL) {
-               wb_ctx = &wb_global_ctx;
+               ctx = &wb_global_ctx;
        }
 
        }
 
-       status = winbindd_send_request(wb_ctx, req_type, 0, request);
+       status = winbindd_send_request(ctx, req_type, 0, request);
        if (status != NSS_STATUS_SUCCESS)
                return (status);
        if (status != NSS_STATUS_SUCCESS)
                return (status);
-       status = winbindd_get_response(wb_ctx, response);
+       status = winbindd_get_response(ctx, response);
 
        return status;
 }
 
        return status;
 }
@@ -739,16 +738,15 @@ NSS_STATUS winbindd_priv_request_response(struct winbindd_context *ctx,
                                          struct winbindd_response *response)
 {
        NSS_STATUS status = NSS_STATUS_UNAVAIL;
                                          struct winbindd_response *response)
 {
        NSS_STATUS status = NSS_STATUS_UNAVAIL;
-       struct winbindd_context *wb_ctx = ctx;
 
        if (ctx == NULL) {
 
        if (ctx == NULL) {
-               wb_ctx = &wb_global_ctx;
+               ctx = &wb_global_ctx;
        }
 
        }
 
-       status = winbindd_send_request(wb_ctx, req_type, 1, request);
+       status = winbindd_send_request(ctx, req_type, 1, request);
        if (status != NSS_STATUS_SUCCESS)
                return (status);
        if (status != NSS_STATUS_SUCCESS)
                return (status);
-       status = winbindd_get_response(wb_ctx, response);
+       status = winbindd_get_response(ctx, response);
 
        return status;
 }
 
        return status;
 }