nwrap: Small code shift in nwrap_ed_inventarize_add_to_existing()
[obnox/samba/samba-obnox.git] / lib / nss_wrapper / nss_wrapper.c
index a8cbc222ac79e4d4f330f933289cf031263644b0..d204ea60a8f31de6b6ee3908819efc88387d115f 100644 (file)
@@ -2610,21 +2610,20 @@ static bool nwrap_ed_inventarize_add_to_existing(struct nwrap_entdata *const ed,
                return false;
        }
 
-       el_new = nwrap_entlist_init(ed);
-       if (el_new == NULL) {
-               return false;
-       }
 
        for (cursor = el; cursor->next != NULL; cursor = cursor->next)
        {
                if (cursor->ed == ed) {
-                       free(el_new);
                        return false;
                }
        }
 
        if (cursor->ed == ed) {
-               free(el_new);
+               return false;
+       }
+
+       el_new = nwrap_entlist_init(ed);
+       if (el_new == NULL) {
                return false;
        }