Memory Concerns

You must allocate and release an array of Slapi_Value structures for vals sized to hold the exact number
of password values for the userpassword attribute on the
entry to check. The resulting array is not NULL terminated.
For a simpler memory allocation model, use slapi_pw_find_valueset() instead.