summaryrefslogtreecommitdiff
path: root/usr/src/lib/librestart/common/librestart.c
diff options
context:
space:
mode:
authorJohn Sonnenschein <johns@joyent.com>2012-05-17 18:26:57 +0000
committerJohn Sonnenschein <johns@joyent.com>2012-05-17 18:26:57 +0000
commit04b244dd661c24b510ac22936decfc0972d202d3 (patch)
tree3ebfef98afc303fddf3415d6fba64e8682f495e8 /usr/src/lib/librestart/common/librestart.c
parenteac250589e41f1b705e1b7427b02b3379aac9f9e (diff)
parenta69187741b83640a90dd8586195456dd50c016a8 (diff)
downloadillumos-joyent-20120517.tar.gz
Merge git.joyent.com:illumos-joyent20120517
Diffstat (limited to 'usr/src/lib/librestart/common/librestart.c')
-rw-r--r--usr/src/lib/librestart/common/librestart.c10
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) {