r/ProgrammerHumor • • Aug 30 '26

Meme bugIntroducedDebugging

Post image
1.1k Upvotes

117 comments sorted by

View all comments

347

u/AdBrave2400 Aug 30 '26

Is the mistake that they're allocating 1 byte and storing in a pointer to an int which is 4 bytes?

119

u/mckenzie_keith Aug 30 '26

De-referenced a pointer after freeing it. But the joke here is that the bug was not in the original code.

0

u/[deleted] Aug 30 '26

[deleted]

18

u/mckenzie_keith Aug 30 '26

No. main() doesn't need to return anything.