From d1e6ffe20e2ccf6a38cfbe4d1bc3a20b92d37fd1 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Thu, 9 Nov 2017 18:24:48 +0000 Subject: 9052 nss_files exec attr search leaks memory on dlclose Reviewed by: Tim Kordas Reviewed by: Jerry Jelinek Reviewed by: Dan McDonald Reviewed by: Richard Lowe Approved by: Gordon Ross --- usr/src/lib/nsswitch/files/common/files_common.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'usr/src/lib/nsswitch/files/common/files_common.c') diff --git a/usr/src/lib/nsswitch/files/common/files_common.c b/usr/src/lib/nsswitch/files/common/files_common.c index 4755aec86b..5892ed1430 100644 --- a/usr/src/lib/nsswitch/files/common/files_common.c +++ b/usr/src/lib/nsswitch/files/common/files_common.c @@ -24,6 +24,7 @@ */ /* * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2017, Joyent, Inc. */ /* @@ -738,3 +739,15 @@ _nss_files_check_name_aliases(nss_XbyY_args_t *argp, const char *line, } return (0); } + +/* + * A few NSS modules hold onto data for the duration of their module. In this + * case, when that module goes away, we must free that data. This is a place + * that allows for modules to register items to take care of. + */ +#pragma fini(_nss_files_fini) +static void +_nss_files_fini(void) +{ + getexecattr_fini(); +} -- cgit v1.2.3