Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Mar 2015 13:21:00 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r279808 - head/usr.sbin/autofs
Message-ID:  <201503091321.t29DL04a011591@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon Mar  9 13:21:00 2015
New Revision: 279808
URL: https://svnweb.freebsd.org/changeset/base/279808

Log:
  Fix memory leak.
  
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.sbin/autofs/common.c

Modified: head/usr.sbin/autofs/common.c
==============================================================================
--- head/usr.sbin/autofs/common.c	Mon Mar  9 13:00:59 2015	(r279807)
+++ head/usr.sbin/autofs/common.c	Mon Mar  9 13:21:00 2015	(r279808)
@@ -615,9 +615,11 @@ node_options_x(const struct node *n, cha
 {
 	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));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503091321.t29DL04a011591>