summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Ross <gwr@racktopsystems.com>2021-10-08 10:39:15 -0400
committerToomas Soome <tsoome@me.com>2022-09-23 09:57:00 +0300
commitbbcfe1fdf407bba4db5c2e62a69b67be0c4cb443 (patch)
treef958cadfbe820681cf597dda0a995c27f621023c
parent589f9b6223af8482576c4b68c4acc0626246eb32 (diff)
downloadillumos-joyent-bbcfe1fdf407bba4db5c2e62a69b67be0c4cb443.tar.gz
14987 smb: DsFreeDcInfo leaks
Reviewed-by: Toomas Soome <tsoome@me.com> Reviewed-by: Garrett D'Amore <gdamore@racktopsystems.com> Reviewed-by: Jim Johnson <jjohnson@racktopsystems.com> Reviewed-by: Jerry Jelinek <gjelinek@racktopsystems.com> Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Reviewed by: Matt Barden <mbarden@tintri.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Patrick Mooney <pmooney@pfmooney.com>
-rw-r--r--usr/src/cmd/idmap/nltest/nltest.c26
-rw-r--r--usr/src/lib/libads/common/dsgetdc.c8
2 files changed, 19 insertions, 15 deletions
diff --git a/usr/src/cmd/idmap/nltest/nltest.c b/usr/src/cmd/idmap/nltest/nltest.c
index 002fe0f157..b86d473f2f 100644
--- a/usr/src/cmd/idmap/nltest/nltest.c
+++ b/usr/src/cmd/idmap/nltest/nltest.c
@@ -11,6 +11,7 @@
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2021 RackTop Systems, Inc.
*/
@@ -184,6 +185,8 @@ cmd_dsgetdcname(char *domname)
(void) printf(" DC Site Name: %s \n", dcinfo->DcSiteName);
(void) printf(" Client Site Name: %s \n", dcinfo->ClientSiteName);
+ DsFreeDcInfo(dcinfo);
+
return (0);
}
@@ -214,7 +217,8 @@ cmd_kick(char *domname)
*/
static void
-help(void) {
+help(void)
+{
(void) printf("\n");
/*
* TODO: We may want to revise this help text. It's basically
@@ -225,17 +229,17 @@ help(void) {
(char *)getexecname());
(void) printf(gettext("where subcommands are:\n"
#if 0 /* not yet */
- " dclist Lists all domain controllers in the domain.\n"
- " dcname Lists the PDC or PDC emulator.\n"
- " dsgetdc Queries DNS server for list of DCs and"
- " their IP addresses and contacts each DC to check"
- " for connectivity.\n"
+ " dclist Lists all domain controllers in the domain.\n"
+ " dcname Lists the PDC or PDC emulator.\n"
+ " dsgetdc Queries DNS server for list of DCs and"
+ " their IP addresses and contacts each DC to check"
+ " for connectivity.\n"
#endif
- " dsgetdcname returns the name of a domain controller in a"
- " specified domain\n"
- " help display help on specified subcommand\n"
- " kick trigger domain controller re-discovery\n"
- "\n"));
+ " dsgetdcname returns the name of a domain controller in a"
+ " specified domain\n"
+ " help display help on specified subcommand\n"
+ " kick trigger domain controller re-discovery\n"
+ "\n"));
exit(1);
}
diff --git a/usr/src/lib/libads/common/dsgetdc.c b/usr/src/lib/libads/common/dsgetdc.c
index a8b45707b9..ae2eddb24e 100644
--- a/usr/src/lib/libads/common/dsgetdc.c
+++ b/usr/src/lib/libads/common/dsgetdc.c
@@ -11,6 +11,7 @@
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2021 RackTop Systems, Inc.
*/
/*
@@ -24,7 +25,7 @@
#include <arpa/inet.h>
#include "dsgetdc.h"
#include "ads_priv.h"
-#include <assert.h>
+#include <sys/debug.h>
#define DSGETDC_VALID_FLAGS ( \
DS_FORCE_REDISCOVERY | \
@@ -112,8 +113,7 @@ _DsGetDcName(const char *ComputerName,
* We have taken pains to make these two the same.
* DOMAIN_CONTROLLER_INFO / struct adspriv_dcinfo
*/
- /* LINTED E_TRUE_LOGICAL_EXPR */
- assert(sizeof (**dcinfo) == sizeof (res.DsGetDcNameRes_u.res0));
+ CTASSERT(sizeof (**dcinfo) == sizeof (res.DsGetDcNameRes_u.res0));
(void) memcpy(*dcinfo, &res.DsGetDcNameRes_u.res0, sizeof (**dcinfo));
/*
@@ -156,7 +156,7 @@ void
DsFreeDcInfo(DOMAIN_CONTROLLER_INFO *dci)
{
if (dci != NULL) {
- xdr_free(xdr_DsGetDcNameRes, (char *)dci);
+ xdr_free(xdr_adspriv_dcinfo, (char *)dci);
free(dci);
}
}