adamwill / 389-ds-base

Forked from 389-ds-base 4 years ago
Clone

798b7e0 Fix double-free in _cl5NewDBFile() error path

1 file Authored by atkac 7 years ago, Committed by mreynolds 7 years ago,
    Fix double-free in _cl5NewDBFile() error path
    
    Although slapi_ch_free should prevent double-free errors, it doesn't work
    in old code because after assignment
    
    (*dbFile)->name = name;
    
    two independent pointers points to the same allocated area and both pointers
    are free()-ed (one directly in error path in _cl5NewDBFile and the second
    in _cl5DBCloseFile, called in error path as well).
    
    Signed-off-by: Mark Reynolds <mreynolds@redhat.com>
    (cherry picked from commit 13e89e5fe96d0e9fe67764307f9a1d340ef593f7)