Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/chfs Memory leak.



details:   https://anonhg.NetBSD.org/src/rev/4de09946d203
branches:  trunk
changeset: 803269:4de09946d203
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Oct 20 06:41:51 2014 +0000

description:
Memory leak.

Found by my code scanner.

ok christos@

diffstat:

 sys/ufs/chfs/chfs_vfsops.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r b0a5de28e13b -r 4de09946d203 sys/ufs/chfs/chfs_vfsops.c
--- a/sys/ufs/chfs/chfs_vfsops.c        Mon Oct 20 03:05:13 2014 +0000
+++ b/sys/ufs/chfs/chfs_vfsops.c        Mon Oct 20 06:41:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chfs_vfsops.c,v 1.11 2014/04/16 18:55:19 maxv Exp $    */
+/*     $NetBSD: chfs_vfsops.c,v 1.12 2014/10/20 06:41:51 maxv Exp $    */
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -152,9 +152,12 @@
                }
                /* Look up the name and verify that it's sane. */
                NDINIT(&nd, LOOKUP, FOLLOW, pb);
-               if ((err = namei(&nd)) != 0 )
+               if ((err = namei(&nd)) != 0 ) {
+                       pathbuf_destroy(pb);
                        return (err);
+               }
                devvp = nd.ni_vp;
+               pathbuf_destroy(pb);
 
                /* Be sure this is a valid block device */
                if (devvp->v_type != VBLK)



Home | Main Index | Thread Index | Old Index