
<     if (ret < 0)
<         goto fail;
---
>     if (ret < 0) {
>         // Add cleanup code here
>         goto fail;
>     }
