24e80bf Ticket #603 - A logic error in str2simple

Authored and Committed by Noriko Hosoi 11 years ago
    Ticket #603 - A logic error in str2simple
    
    Fix description: str2simple sets the strdup'ed type this way:
        if ( f->f_choice == LDAP_FILTER_PRESENT ) {
           f->f_type = slapi_ch_strdup( str );
        } else if ( unescape_filter ) {
           f->f_avtype = slapi_ch_strdup( str );
        } if ( !unescape_filter ) {
           f->f_avtype = slapi_ch_strdup( str );
        }
    If f_choice is LDAP_FILTER_PRESENT and !unescape_filter is
    true, the first strdup'ed string is leaked since f_type
    and f_avtype share the same memory.  But currently, str2simple
    is not called with (unescape_filter == 0).  Thus there is no
    chance to satisfy the condition.  This patch fixes the flaw.
    
    https://fedorahosted.org/389/ticket/603
    
    Reviewed by Rich (Thank you!!)