summaryrefslogtreecommitdiffstats
path: root/usr.sbin/autofs
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-03-09 13:21:00 +0000
committertrasz <trasz@FreeBSD.org>2015-03-09 13:21:00 +0000
commit558260a40392297a93117f4a549651e4e295c318 (patch)
treeed3ba7aee202fa44319c60947d8b69ba5eb6adcc /usr.sbin/autofs
parent622e1a5d993aef0d1b3f936ffa228e8dd181d413 (diff)
downloadFreeBSD-src-558260a40392297a93117f4a549651e4e295c318.zip
FreeBSD-src-558260a40392297a93117f4a549651e4e295c318.tar.gz
Fix memory leak.
MFC after: 1 month Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin/autofs')
-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