Do I need to free all memory that is malloced?

R

Randy Howard

Keith Thompson wrote
(in article said:
It would be more accurate to say that very nearly nothing a user
program running without elevated privileges does will bring down a
modern OS. There are, of course, exceptions (OS bugs,
denial-of-service attacks, etc.).

Buggy drivers can often be tickled in unexpected ways by doing
something as simple as

cd /dev
sum *

wait a while. Older SVR4's back in the day would vapor lock
nicely when you did it. I haven't tried it on a modern kernel
though, it was too painful last time I tried. :)
The narrower point here is that calling free() with an invalid pointer
(e.g., "p = malloc(whatever); free(p+2);") is likely to crash the
individual program, but is highly unlikely to crash the entire OS.

Fair enough.
 
M

Michael Wojcik

Perhaps it is just my bad luck to encounter only
incorrectly configured systems;

That's possible.
or the number of correctly configured systems is lower than ideal.

That, unfortunately, is absolutely certain.

--
Michael Wojcik (e-mail address removed)

Even if Jesus set up a blogging cafe in the center of Rockport, Texas
and extolled the virtues of a woman's right to choose while snapping
pictures of gay weddings with his Nokia, it would have made no
difference to this election. -- Ashlee Vance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top