#38 idviews: clear intermediate target DN in all cases
Merged by abbra. Opened by abbra.
abbra/slapi-nis valgrind-leaks-cleanup  into  master

Download 38.patch

When processing a search request, slapi-nis attempts to detect an ID
View lookup. A target DN is modified by extracting an ID view name. This
temporary string is freed in the successful case but left unotouched if
ID View wasn't requested. As a result, small leaks on each search
request accumulate and a memory can get lost.

Resolves: rhbz#1866113

Signed-off-by: Alexander Bokovoy abokovoy@redhat.com

@tbordaz please review

I think this is another instance of https://pagure.io/slapi-nis/issue/37

The fix looks good but I think you may want to call 'slapi_ch_free_string(&target);' in that branch

if (cbdata.answer == FALSE) {
    slapi_log_error(SLAPI_LOG_PLUGIN,
                               cbdata.state->plugin_desc->spd_id,
                               "The search base didn't match any of the containers, "
                               "ignoring search\n");
    slapi_ch_free_string(&target);
    return 0;
}

rebased onto dbe1e300171e04cc328a4f31d0bffcac056e7cfa

Thanks, updated.

The patch looks good to me ACK

Pull-Request has been merged by abbra

Metadata