memesearch
Second Rule of Memory Safety

Second Rule of Memory Safety

Download Find similar pictures
Text on the meme
Remember: the second rule of memory safety in C is to always clean up after yourself void *cleanup(void *ptr) { free(ptr); free(ptr); // extra clean return ptr; }
What it means

A C code snippet defines a cleanup function that frees the same pointer twice and then returns it. The joke is that “cleaning up after yourself” is taken too literally, causing a double-free memory error. EN: A C code snippet defines a cleanup function that frees the same pointer twice and then returns it. The joke is that “cleaning up after yourself” is taken too literally, causing a double-free memory error.

Objects
Tags
Source
Type
image
Size
800×305 · 32.6 KiB
Mood
саркастичный, абсурдный
Language
en
Added