There is a mem leak at at least 3 points in ucstr.c file inside struct berval * UTF8bvnormalize() function. Following are the positions:
if ( out == NULL ) {
return NULL
}
However, we have already allocated memory to "newbv" field earlier. There are three places where this is being done.
The memory for "newbv" field should have been freed before returning to the caller in case of failure.