Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The benefits of this method are that the code is cleaner and we prevent the rewriting of similar code upon every function error.

Info

Many effective examples of goto-chains are quite large. Once such example can be found in the linux kernel (v2.6.xx) in the function copy_process() in kernel/fork.c.

Risk Assessment

Failure to free allocated memory or close opened files results in a memory leak and possibly unexpected results.

...