diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c index 0b4adc140807..f9687c203a79 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)); }