That&#x27;s a very common pattern in Linux kernel code, where there&#x27;s also nested cleanups, and is one of the most suitable use-cases for a goto.<p>Although in your example, if the code really was doing only that much, I&#x27;d recognise the ||&#x2F;&amp;&amp; &quot;ladder&quot; structure and write it like this instead:<p><pre><code>    if(!(p=a()) &amp;&amp; (q=b()) &amp;&amp; (r=c()))) {
     free(p);
     free(q);
     free(r);
    }</code></pre>