I generally prefer goto's for error handling.
#define IfTrue(x) if (!(x)) goto OnError
Modified code looks as follows:
int myCode(....) {
IfTrue(Operation1( a, b ));
pStruct = (someStruct*)malloc( sizeof( someStruct ) );
IfTrue(pStruct);
goto OnSucces;
OnError:
if (pStruct) {
//cleanup
}
OnSuccess:
return ...
}
-----------------
If you can write cleanup your mess in the OnError label from any error that happens in the function, you can always jump to OnError on error. You can easily extend the macro to take a error code to return, incase the check fails.