Author: trasz
Date: Thu May 21 13:21:03 2015
New Revision: 283229
URL: https://svnweb.freebsd.org/changeset/base/283229

Log:
  MFC r279808:
  
  Fix memory leak.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/usr.sbin/autofs/common.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/autofs/common.c
==============================================================================
--- stable/10/usr.sbin/autofs/common.c  Thu May 21 13:19:44 2015        
(r283228)
+++ stable/10/usr.sbin/autofs/common.c  Thu May 21 13:21:03 2015        
(r283229)
@@ -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));
 }
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to