The malloc and free should both be conditional (based on videoIO). However, I do notice that there will be a leak if xvipc fails and sets videoIO to false without freeing pGlint->Options. What about just initializing Options to NULL and free-ing it unconditionally if there's a failure at NewAdaptorPriv?