bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

value of dangling pointer


From: Kalle Olavi Niemitalo
Subject: value of dangling pointer
Date: 01 Aug 2001 01:47:27 +0300

hostmux/mux.c (free_name) does this:

  free ((char *)nm->name);
  if (nm->name != nm->canon)
    free ((char *)nm->canon);

However, according to the C99 N869 draft, "The value of a pointer
that refers to freed space is indeterminate" (7.20.3 [#1]), which
causes undefined behavior if used (3.18 [#1]).  IIRC, the final
standard has a similar rule.

Does some undocumented GCC extension make such use valid, or
should the two statements be swapped?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]