Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When a program reads passwords or other sensitive information, it should perform whatever processing is required, and then immediately erase the information from memory. (We show an example of this in Section 8.5.) Leaving such information in memory is a security risk, for the following reasons:
The virtual memory page containing the data may be swapped out (unless it is locked in memory using mlock() or similar), and could then be read from the swap area by a privileged program.
If the process receives a signal that causes it to produce a core dump file, then that file may be read to obtain the information.