it's better to use constructions such as
<pre>
status = some_error;
if (ippInitAlloc(&pDCTSpec, ..) &gt;= 0 && ippGetBufSize(...) &gt;= 0)
{
    buf.allocate(...);
    status = ippFunc(...);
}
if(pDCTSpec)
    ippFree(pDCTSpec);
return status &gt;= 0;
</pre>

to avoid duplicated and error-prone code if(status &lt; 0) { free something and return false }