fchdir: avoid memory leak on re-registration.
authorEric Blake <ebb9@byu.net>
Tue, 8 Dec 2009 17:23:27 +0000 (10:23 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 9 Dec 2009 04:14:26 +0000 (21:14 -0700)
commitaeb9a8a8a97f8b876a378ae4fe330f131437b348
tree3b9f3da81f81459b13fad25b8da7aad20473add5
parent5aad650f4e093269e4184cb150f735f6999784d6
fchdir: avoid memory leak on re-registration.

Some code paths (such as dup3) could overwrite one registered
directory fd with another, and must not leak the old name.

* lib/fchdir.c (ensure_dirs_slot): Avoid memory leak.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/fchdir.c