Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Dangling pointer, use after free, double free » ?

Aussi appelé : dangling pointer · use after free · double free

Definition 5.3 University Computer Science — Year 1 · Chapitre 5 — Dynamic Memory

After free(p), every pointer that held the block’s address is a dangling pointer: it still holds the number, but the block is no longer the program’s. Reading or writing through it is a use after free; passing it to free again is a double free. Both are undefined behaviour.

Freeing a block through one pointer leaves every other copy of its address dangling. Nothing in the pointers changes; only the block’s status does, which is why the error is invisible in the source.
Freeing a block through one pointer leaves every other copy of its address dangling. Nothing in the pointers changes; only the block’s status does, which is why the error is invisible in the source.
Lire dans le chapitre →