diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2008-06-08 02:40:50 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2008-06-08 02:40:50 +0000 |
commit | 84b5006302653fa71fa409875dcb97d7a08d9945 (patch) | |
tree | 19e8bf526d30e95e8b2e32d7dd6a1fbf19646864 /libexec | |
parent | 451f1e3f291f7aa0a928696f18db95145845d998 (diff) |
When prebind_newfile() is called the input file is replaced with the new
file, thus leaking the file descriptor, close the input file when it done.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ld.so/ldconfig/prebind_delete.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/ld.so/ldconfig/prebind_delete.c b/libexec/ld.so/ldconfig/prebind_delete.c index 2e9fc6779e7..1edec984644 100644 --- a/libexec/ld.so/ldconfig/prebind_delete.c +++ b/libexec/ld.so/ldconfig/prebind_delete.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prebind_delete.c,v 1.8 2006/07/28 21:38:05 drahn Exp $ */ +/* $OpenBSD: prebind_delete.c,v 1.9 2008/06/08 02:40:49 drahn Exp $ */ /* * Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com> @@ -258,6 +258,7 @@ prebind_newfile(int infd, char *name, struct stat *st, off_t orig_size) } } free(buf); + close (infd); /* now back track, and delete the header */ if (prebind_remove_load_section(outfd, newname) == -1) |