adamwill / 389-ds-base

Forked from 389-ds-base 4 years ago
Clone

487932d coverity - mbo dead code - winsync leaks, deadcode, null check, test code

Authored and Committed by rmeggins 11 years ago
    coverity - mbo dead code - winsync leaks, deadcode, null check, test code
    
    Reviewed by: mreynolds (Thanks!)
    Cherry-picked from 3dcca62d79ece2ef02b8796a1ffd1465d3e69487
    
    This fixes the following issues:
    13060 Logically dead code
    In memberof_test_membership_callback(): Code can never be reached because of a logical contradiction
    
    13059 Use after free
    In windows_plugin_cleanup_agmt(): A pointer to freed memory is dereferenced, used as a function argument, or otherwise used
    
    13058 Dereference before null check
    In windows_generate_update_mods(): All paths that lead to this null pointer comparison already dereference the pointer earlier
    
    13057 Dereference before null check
    In windows_generate_update_mods(): All paths that lead to this null pointer comparison already dereference the pointer earlier
    
    13056 Resource leak
    In windows_plugin_add(): Leak of memory or pointers to system resources
    
    13055 Dereference after null check
    In windows_generate_update_mods(): Pointer is checked against null but then dereferenced anyway
    
    13054 Dereference after null check
    In test_winsync_pre_ds_search_all_cb(): Pointer is checked against null but then dereferenced anyway
    
    I've also commented out any code from the test winsync plugin except for
    logging the entrance and exit of each function.