diff options
author | Matt Barden <mbarden@tintri.com> | 2022-09-27 16:56:41 -0400 |
---|---|---|
committer | Matt Barden <mbarden@tintri.com> | 2022-11-04 20:05:25 -0400 |
commit | 549ab26f262a63e8892b99d530a98fea6423ad63 (patch) | |
tree | cee53c1f3bb51318cbc14c318db6afa13c4d6ebe /usr/src | |
parent | 56a2adb63cd7b5ba73bb3f0fb3930b2d2730513e (diff) | |
download | illumos-gate-549ab26f262a63e8892b99d530a98fea6423ad63.tar.gz |
15084 SMBD leaks memory during startup/refresh
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com>
Reviewed by: Marco van Wieringen <mvw@planets.elm.net>
Approved by: Dan McDonald <danmcd@mnx.io>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/libshare/common/libsharecore.c | 3 | ||||
-rw-r--r-- | usr/src/lib/smbsrv/libsmb/common/smb_cfg.c | 12 | ||||
-rw-r--r-- | usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c | 3 |
3 files changed, 8 insertions, 10 deletions
diff --git a/usr/src/lib/libshare/common/libsharecore.c b/usr/src/lib/libshare/common/libsharecore.c index c15291d19d..9f08c0c220 100644 --- a/usr/src/lib/libshare/common/libsharecore.c +++ b/usr/src/lib/libshare/common/libsharecore.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright 2022 Tintri by DDN, Inc. All rights reserved. * Copyright (c) 2016 by Delphix. All rights reserved. */ @@ -1604,7 +1604,6 @@ parse_sharetab(sa_handle_t handle) sa_group_t lgroup; xfs_sharelist_t *list = get_share_list(&err); - list = get_share_list(&err); if (list == NULL) return (legacy); diff --git a/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c b/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c index 88890f4f8c..b295916cb3 100644 --- a/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c +++ b/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2020 Tintri by DDN, Inc. All rights reserved. + * Copyright 2022 Tintri by DDN, Inc. All rights reserved. * Copyright 2021 RackTop Systems, Inc. */ @@ -904,6 +904,7 @@ int smb_config_get_localuuid(uuid_t uu) { char *s; + int rc = 0; uuid_clear(uu); s = smb_config_getenv_generic(MACHINE_UUID, IDMAP_FMRI_PREFIX, @@ -911,12 +912,11 @@ smb_config_get_localuuid(uuid_t uu) if (s == NULL) return (-1); - if (uuid_parse(s, uu) < 0) { - free(s); - return (-1); - } + if (uuid_parse(s, uu) < 0) + rc = -1; - return (0); + free(s); + return (rc); } static int diff --git a/usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c b/usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c index 0a07771985..66a187abbb 100644 --- a/usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c +++ b/usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. + * Copyright 2022 Tintri by DDN, Inc. All rights reserved. * Copyright 2021 RackTop Systems, Inc. */ @@ -482,7 +482,6 @@ again: (void) mutex_lock(&smb_ads_cached_host_mtx); if (!smb_ads_cached_host_info) smb_ads_cached_host_info = smb_ads_dup_host_info(host); - host = smb_ads_dup_host_info(smb_ads_cached_host_info); (void) mutex_unlock(&smb_ads_cached_host_mtx); out: |