Example: How to protect local variables with fz_var

A corrected version of the above example is therefore:


\begin{lstlisting}
house_t *build_house(fz_context *ctx)
{
walls_t *w = NULL;
...
...haps by simply returning NULL. */
return NULL;
}
return h;
}
\end{lstlisting}

Note the calls to fz_var. These warn the compiler that it should take care not to lose updates to w or r if an exception is thrown in the fz_try. See Rule 5 in ExceptionRules ExceptionRules below.