summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsm26363 <none@none>2008-01-17 09:47:00 -0800
committersm26363 <none@none>2008-01-17 09:47:00 -0800
commitb86fdaf4fe6bf9ee985c1aceef3b0a405aa20ebe (patch)
tree0715e8dab85c2148d5162efba8d501450e4d5834
parent2140e8bf1169b377ef2328ad4540b3fd4a1ed43b (diff)
downloadillumos-gate-b86fdaf4fe6bf9ee985c1aceef3b0a405aa20ebe.tar.gz
6649124 dhcpconfig memory leak, needs to call res_ndestroy
-rw-r--r--usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/dd_opt.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/dd_opt.c b/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/dd_opt.c
index 926bf68933..2ed90b8c97 100644
--- a/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/dd_opt.c
+++ b/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/dd_opt.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -326,7 +325,10 @@ get_dns_domain(const char *arg)
}
}
}
- free(statp);
+ if (statp != NULL) {
+ (void) res_ndestroy(statp);
+ free(statp);
+ }
return (opt);
}
@@ -374,7 +376,10 @@ get_dns_servers(const char *arg)
opt->u.ret.count = j;
}
}
- free(statp);
+ if (statp != NULL) {
+ (void) res_ndestroy(statp);
+ free(statp);
+ }
return (opt);
}