diff options
author | Bryan Cantrill <bryan@joyent.com> | 2012-06-09 17:39:57 -0700 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2012-06-09 17:39:57 -0700 |
commit | 3dd94f79268fa1debdd48a44e49c9958fcbad2eb (patch) | |
tree | e3e5409575251cf8300730d0cdcdb89cf0fc5635 /usr/src/lib/librestart/common/librestart.c | |
parent | 0c0855db3275acd1c398a13e8c056eae7672e682 (diff) | |
download | illumos-joyent-3dd94f79268fa1debdd48a44e49c9958fcbad2eb.tar.gz |
2831 bring Joyent/SmartOS OS-1186 and OS-1187 to Illumos
Reviewed by: Theo Schlossnagle <jesus@omniti.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/lib/librestart/common/librestart.c')
-rw-r--r-- | usr/src/lib/librestart/common/librestart.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/src/lib/librestart/common/librestart.c b/usr/src/lib/librestart/common/librestart.c index 7cf1d30e04..54fcafd6ce 100644 --- a/usr/src/lib/librestart/common/librestart.c +++ b/usr/src/lib/librestart/common/librestart.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #include <libintl.h> @@ -3333,6 +3334,10 @@ restarter_get_method_context(uint_t version, scf_instance_t *inst, * defaults that provide historic init behavior. */ if (mc_used == 0) { + free(cip->pwbuf); + free(cip->vbuf); + free(cip->working_dir); + (void) memset(cip, 0, sizeof (*cip)); cip->uid = 0; cip->gid = 0; @@ -3348,8 +3353,11 @@ out: scf_pg_destroy(instpg); scf_pg_destroy(methpg); - if (cip->pwbuf != NULL) + if (cip->pwbuf != NULL) { free(cip->pwbuf); + cip->pwbuf = NULL; + } + free(cip->vbuf); if (err->type != 0) { |