Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Dangling pointer, use after free, double free?

Dikenal juga sebagai: dangling pointer · use after free · double free

Definition 5.3 University Computer Science — Year 1 · Bab 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.
Baca dalam konteks →