From f55d10feb94acfdf2f187041fd410f57119ba49b Mon Sep 17 00:00:00 2001 From: trasz Date: Thu, 21 May 2015 13:21:03 +0000 Subject: MFC r279808: Fix memory leak. Sponsored by: The FreeBSD Foundation --- usr.sbin/autofs/common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c index 0b4adc1..f9687c2 100644 --- a/usr.sbin/autofs/common.c +++ b/usr.sbin/autofs/common.c @@ -615,9 +615,11 @@ node_options_x(const struct node *n, char *x) { char *options; + if (n == NULL) + return (x); + options = separated_concat(x, n->n_options, ','); - if (n->n_parent == NULL) - return (options); + free(x); return (node_options_x(n->n_parent, options)); } -- cgit v1.1