nwrap: Always fully initialze an nwrap_backend
authorAndreas Schneider <asn@samba.org>
Thu, 2 Apr 2020 07:37:54 +0000 (09:37 +0200)
committerAndreas Schneider <asn@samba.org>
Thu, 2 Apr 2020 09:28:52 +0000 (11:28 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
src/nss_wrapper.c

index fc03e27d36776338b28e965a2af0e96240ebd3a9..a192f0e21990fdb864eed32c60f022ef74155bfe 100644 (file)
@@ -1807,9 +1807,11 @@ static bool nwrap_module_init(const char *name,
 
        b = &((*backends)[*num_backends]);
 
-       b->name = name;
-       b->ops = ops;
-       b->so_path = so_path;
+       *b = (struct nwrap_backend) {
+               .name = name,
+               .ops = ops,
+               .so_path = so_path,
+       };
 
        if (so_path != NULL) {
                b->so_handle = nwrap_load_module(so_path);
@@ -1817,9 +1819,6 @@ static bool nwrap_module_init(const char *name,
                if (b->symbols == NULL) {
                        return false;
                }
-       } else {
-               b->so_handle = NULL;
-               b->symbols = NULL;
        }
 
        (*num_backends)++;