Versions Compared

Key

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

...

The function uses 17 goto labels (not all displayed here) to perform cleanup code should any internal function yield an error code. If no errors occur, the program returns a pointer to the new process p. If any error occurs, the program diverts control to a particular goto label, which performs cleanup for sections of the function that have currently been successfully executed but not for sections of the function that have not yet been executed. Consequently, only resources that were successfully opened are actually closed.

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

MEM12-C

low

probable

medium

P4

L3

Related Guidelines

ISO/IEC 9899:2011 Section 7.22.3, "Memory management functions," and Section 7.21.5, "File access functions"

Bibliography

...

Kernel Sourcecode (v2.6.xx)2.6.29, kernel/fork.c, the copy_process()

...

Function
[Seacord 2005]Chapter 4, "Dynamic Memory Management"

 

...