[haiku-commits] r36177 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs

  • From: revol@xxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 12 Apr 2010 02:05:41 +0200 (CEST)

Author: mmu_man
Date: 2010-04-12 02:05:40 +0200 (Mon, 12 Apr 2010)
New Revision: 36177
Changeset: http://dev.haiku-os.org/changeset/36177/haiku

Modified:
   haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c
Log:
Fix a possible mem leak in case of error.


Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c  2010-04-11 
23:56:02 UTC (rev 36176)
+++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c  2010-04-12 
00:05:40 UTC (rev 36177)
@@ -398,7 +398,6 @@
                ERRPRINT("fs_walk - VNID = %d\n",*vnid);
 
                ntfs_inode_close(bi);
-               free(unicode);
 
                if (*vnid == (u64)-1) {
                        result = EINVAL;
@@ -415,6 +414,9 @@
 exit:
        ERRPRINT("fs_walk - EXIT, result is %s\n", strerror(result));
 
+       if (unicode)
+               free(unicode);
+
        UNLOCK_VOL(ns);
 
        return result;


Other related posts:

  • » [haiku-commits] r36177 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs - revol