This question already has an answer here:
I know this is very system dependent, but say we have a program, call it Program A. It contains sensitive data that a hacker wants to get into. One could simply close Program A, and run Program B that allocates lots of memory (
malloc). Now since
malloc doesn't usually clear the memory it allocates, you could potentially have access to Program A's memory.
Of course this would require lots of inspection of hex dumps and reverse engineering, but is this possible? Are there certain measures a program designer could take when designing an application to ensure this can't happen?