Bonjour,

La FAQ dans sa question Que vaut un pointeur après free() ?

énonce :

Le pointeur reste inchangé (en effet il est passé par valeur à free)
Je pense que cette assertion est inexacte. Voici les passages de la Norme sur lesquels je m'appuie pour dire cela :

7.20.3 Memory management functions
1 (...) The lifetime of an allocated object extends from the allocation until the deallocation.
6.2.4 Storage durations of objects
1 2 An object has a storage duration that determines its lifetime. There are three storage durations: static, automatic, and allocated. Allocated storage is described in 7.20.3.
(...)
The value of a pointer becomes indeterminate when the object it points to reaches the end of its lifetime.
Cordialement