Skip to main content

Timeline for how free() works?

Current License: CC BY-SA 3.0

Post Revisions

15 events
when toggle format what by license comment
Aug 10, 2011 at 7:57 comment added Dhaivat Pandya That's what I'm saying, that's its not standardized the pointer should be NULL, and, even if it isn't, he shouldn't be dereferencing something that doesn't have a set location to point to.
Aug 10, 2011 at 7:56 vote accept Jeegar Patel
Aug 10, 2011 at 7:55 vote accept Jeegar Patel
Aug 10, 2011 at 7:56
Aug 10, 2011 at 7:49 vote accept Jeegar Patel
Aug 10, 2011 at 7:55
Aug 10, 2011 at 7:31 comment added David Heffernan @Dhaivat I don't see anywhere in this code that sets the pointer to NULL.
S Aug 10, 2011 at 7:28 history suggested Dhaivat Pandya CC BY-SA 3.0
improved formatting
Aug 10, 2011 at 7:26 answer added Jerry Coffin timeline score: 1
Aug 10, 2011 at 7:24 comment added Dhaivat Pandya No, its not always safe because that isn't standardized, and plus, you're not supposed to deference it when its NULL either. It leads to seg faults on any decent system. And, please refrain from using caps lock in the future.
Aug 10, 2011 at 7:23 answer added Chris Lutz timeline score: 4
Aug 10, 2011 at 7:23 comment added Jeegar Patel after declaration of any pointer doesnt points to NULL...THEN ITS SAFE.. DOESNT IT..??
Aug 10, 2011 at 7:22 answer added Owen timeline score: 3
Aug 10, 2011 at 7:20 comment added Dhaivat Pandya In the printf "before malloc valu", you are dereferencing a NULL pointer. Don't do that.
Aug 10, 2011 at 7:19 review Suggested edits
S Aug 10, 2011 at 7:28
Aug 10, 2011 at 7:18 answer added David Heffernan timeline score: 3
Aug 10, 2011 at 7:16 history asked Jeegar Patel CC BY-SA 3.0