Hacker News new | ask | show | jobs
by UnoriginalGuy 3335 days ago
This is C. There's nothing questionable about this "style." It is just how C is written. How else are you going to free resources without a code section to do it? Copy/paste it dozens of times?

The specific code isn't "goto fail" anyway, it is more akin to a finally block.

2 comments

I think erdeszt is just referring to the lack of curly braces around the statements governed by the if statements. This can be done around any single-line statement block, and is generally safer in the face of merges from version control.
I was referring to the lack of curly braces around the body of the then clause. This code has nothing to do with resource management and gotos per se so I don't see where your frustration and attack comes from.
If you compile your code with -Werror -Wmisleading-indentation it's no more dangerous than writing Python.