summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-05-06 01:03:32 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-05-06 01:03:32 +0000
commita48034f6db66505a34cadeff494212aa66b2e307 (patch)
tree256ed304c6a03b1d684b9b0f8bc85eec5c92a4ad
parent84daec8f943e96c941352144ad780551e33992f8 (diff)
Fix a memory leak in _dl_load_dep_libs()
ok otto@ guenther@
-rw-r--r--libexec/ld.so/loader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 4d79ee2f5a5..31b0c15c3d5 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.153 2015/01/22 05:48:17 deraadt Exp $ */
+/* $OpenBSD: loader.c,v 1.154 2015/05/06 01:03:31 jsg Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -326,6 +326,7 @@ _dl_load_dep_libs(elf_object_t *object, int flags, int booting)
DL_DEB(("dlopen: failed to open %s\n",
libname));
_dl_free(liblist);
+ _dl_free(randomlist);
return (1);
}
}
@@ -337,6 +338,7 @@ _dl_load_dep_libs(elf_object_t *object, int flags, int booting)
_dl_link_child(liblist[loop].depobj, dynobj);
}
_dl_free(liblist);
+ _dl_free(randomlist);
}
dynobj = dynobj->next;
}