diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2013-05-04 09:23:34 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2013-05-04 09:23:34 +0000 |
commit | 3052b912c2f8d17ef6a5102420d185232ea6391d (patch) | |
tree | 00edc456d0446a685be885ea4263fbc2ba7cce2a /libexec/ld.so | |
parent | d15c4cbeb9d7035a20ceb602f498652179326d1e (diff) |
fix use after free in error paths
ok sthen@ jung@ fgsch@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r-- | libexec/ld.so/ldconfig/prebind.c | 4 | ||||
-rw-r--r-- | libexec/ld.so/ldconfig/prebind_delete.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libexec/ld.so/ldconfig/prebind.c b/libexec/ld.so/ldconfig/prebind.c index f908e45680c..9d84a9a6458 100644 --- a/libexec/ld.so/ldconfig/prebind.c +++ b/libexec/ld.so/ldconfig/prebind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prebind.c,v 1.19 2013/03/20 21:49:59 kurt Exp $ */ +/* $OpenBSD: prebind.c,v 1.20 2013/05/04 09:23:33 jsg Exp $ */ /* * Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com> * @@ -2002,8 +2002,8 @@ prebind_writenewfile(int infd, char *name, struct stat *st, off_t orig_size, return (0); fail: - free(newname); unlink(newname); + free(newname); close(outfd); return (-1); } diff --git a/libexec/ld.so/ldconfig/prebind_delete.c b/libexec/ld.so/ldconfig/prebind_delete.c index 400f32e37a7..bc5eb77cad4 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.11 2012/03/21 04:28:45 matthew Exp $ */ +/* $OpenBSD: prebind_delete.c,v 1.12 2013/05/04 09:23:33 jsg Exp $ */ /* * Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com> @@ -285,8 +285,8 @@ prebind_newfile(int infd, char *name, struct stat *st, off_t orig_size) return (outfd); fail: - free(newname); unlink(newname); + free(newname); close(outfd); return (-1); } |