Versions Compared

Key

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

...

Code Block
bgColor#ccccff
langc
void cleanup(void) {
  /* deleteDelete temporary files, restore consistent state, etc */
}

int main(void) {
  if (atexit(cleanup) != 0) {
    /* Handle error */
  }

  /* ... */

  if (/* something bad happened */) {
    exit(EXIT_FAILURE);
  }

  /* ... */
}

...

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

...

Bibliography

...

]Section 7.2.1.1, "The assert macro,"

...

ISO/IEC PDTR 24772 "REU Termination strategy"

...

...