summaryrefslogtreecommitdiff
path: root/usr/src/cmd/svc
diff options
context:
space:
mode:
authorTom Whitten <tom.whitten@oracle.com>2010-05-18 08:43:38 -0700
committerTom Whitten <tom.whitten@oracle.com>2010-05-18 08:43:38 -0700
commit1ad2c4535511d23db9400732da7b29bcb0bdd9f6 (patch)
treece7d13746de221c2095fa3ef877c76a7272ec9c0 /usr/src/cmd/svc
parentec16669a50f11a5926eecae869868b4fb6f61c19 (diff)
downloadillumos-joyent-1ad2c4535511d23db9400732da7b29bcb0bdd9f6.tar.gz
6765749 svc.configd leaked two million nodes
Diffstat (limited to 'usr/src/cmd/svc')
-rw-r--r--usr/src/cmd/svc/configd/rc_node.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr/src/cmd/svc/configd/rc_node.c b/usr/src/cmd/svc/configd/rc_node.c
index f08f446e76..57b7ebcc69 100644
--- a/usr/src/cmd/svc/configd/rc_node.c
+++ b/usr/src/cmd/svc/configd/rc_node.c
@@ -6835,15 +6835,21 @@ tx_allow_value(const void *cmds_arg, size_t cmds_sz, rc_node_t *pg)
case REP_PROTOCOL_TX_ENTRY_REPLACE:
/* Check type */
(void) pthread_mutex_lock(&pg->rn_lock);
+ ok = B_FALSE;
if (rc_node_find_named_child(pg,
(const char *)cmds[0].rptc_data,
REP_PROTOCOL_ENTITY_PROPERTY, &prop) ==
REP_PROTOCOL_SUCCESS) {
- ok = (prop != NULL &&
- prop->rn_valtype == cmds[0].rptc_type);
- } else {
- /* Return more particular error? */
- ok = B_FALSE;
+ if (prop != NULL) {
+ ok = prop->rn_valtype ==
+ cmds[0].rptc_type;
+ /*
+ * rc_node_find_named_child()
+ * places a hold on prop which we
+ * do not need to hang on to.
+ */
+ rc_node_rele(prop);
+ }
}
(void) pthread_mutex_unlock(&pg->rn_lock);
if (ok)