When you are no longer using the Slapi_ValueSet structure, you should free it from memory by using slapi_valueset_free() .