cd1538b providers/proxy: fixed erroneous free of orig_grp

1 file Authored by atikhonov 5 years ago, Committed by jhrozek 5 years ago,
    providers/proxy: fixed erroneous free of orig_grp
    
    Function `remove_duplicate_group_members(mem_ctx, orig_grp, new_grp)`
    in case of empty orig_grp would return as a result:
    ```
    *new_grp = talloc_steal(mem_ctx, orig_grp);
    ```
    Since mem_ctx is freed in caller function that leads to deallocation
    of orig_grp and to "use after free" bug.
    
    Code was changes so remove_duplicate_group_members() behaves consistently
    and always returns a new group created in given mem context.
    
    Resolves: https://pagure.io/SSSD/sssd/issue/3931
    
    Reviewed-by: Pavel Březina <pbrezina@redhat.com>
    
        
file modified
+35 -31