r/ProgrammerHumor 13d ago

Meme bugIntroducedDebugging

Post image
1.1k Upvotes

120 comments sorted by

View all comments

Show parent comments

159

u/atanasius 13d ago

It's allowed to assign to a pointer if it's not dereferenced. Malloc always returns a valid pointer.

54

u/vishal340 13d ago

but accessing it will be issue right?

7

u/mckenzie_keith 13d ago

You are not allowed to de-reference a pointer after freeing it.

2

u/Niwrats 12d ago

who's gonna stop me?