summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-05-21 13:21:03 +0000
committertrasz <trasz@FreeBSD.org>2015-05-21 13:21:03 +0000
commitf55d10feb94acfdf2f187041fd410f57119ba49b (patch)
tree867fd2059eb02b00a2356c225021562bce557b8d /usr.sbin
parent609485e24dfcb4457de1f7e13c1462c193c78a95 (diff)
downloadFreeBSD-src-f55d10feb94acfdf2f187041fd410f57119ba49b.zip
FreeBSD-src-f55d10feb94acfdf2f187041fd410f57119ba49b.tar.gz
MFC r279808:
Fix memory leak. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/autofs/common.c6
1 files changed, 4 insertions, 2 deletions
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));
}
OpenPOWER on IntegriCloud