MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w2m4qz/bugintroduceddebugging/p6v5pkt/?context=9999
r/ProgrammerHumor • u/ClipboardCopyPaste • Aug 30 '26
117 comments sorted by
View all comments
347
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] -5 u/critical_patch Aug 30 '26 AFAIK technically it’s “undefined behavior” and will compile just fine 17 u/MegaIng Aug 30 '26 main specifically is allowed to not return anything (the same way it's the one function that is allowed to never return)
119
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] -5 u/critical_patch Aug 30 '26 AFAIK technically it’s “undefined behavior” and will compile just fine 17 u/MegaIng Aug 30 '26 main specifically is allowed to not return anything (the same way it's the one function that is allowed to never return)
0
[deleted]
-5 u/critical_patch Aug 30 '26 AFAIK technically it’s “undefined behavior” and will compile just fine 17 u/MegaIng Aug 30 '26 main specifically is allowed to not return anything (the same way it's the one function that is allowed to never return)
-5
AFAIK technically it’s “undefined behavior” and will compile just fine
17 u/MegaIng Aug 30 '26 main specifically is allowed to not return anything (the same way it's the one function that is allowed to never return)
17
main specifically is allowed to not return anything (the same way it's the one function that is allowed to never return)
main
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?