shithub: lwext4

Download patch

ref: db82248ac1d7157d75763a52be0beade937605fe
parent: 6728257371eb4331be5dd3f04162d2756e164435
author: ngkaho1234 <[email protected]>
date: Sat Sep 26 08:43:55 EDT 2015

FIX: double free of inode reference happens.

--- a/lwext4/ext4.c
+++ b/lwext4/ext4.c
@@ -874,10 +874,6 @@
 		goto Finish;
 
 Finish:
-	if (r != EOK)
-		ext4_fs_put_inode_ref(child_ref);
-
-	ext4_fs_put_inode_ref(parent_ref);
 	return r;
 }
 
--- a/lwext4/ext4_debug.h
+++ b/lwext4/ext4_debug.h
@@ -40,6 +40,7 @@
 #include "ext4_config.h"
 #include "ext4_errno.h"
 
+#include <assert.h>
 #include <stdint.h>
 #include <stdio.h>
 
@@ -106,6 +107,7 @@
 		if (!(_v)) {                                                   \
 			printf("Assertion failed:\nmodule: %s\nline: %d\n",    \
 			       __FILE__, __LINE__);                            \
+			assert(_v);                                            \
 		}                                                              \
 	} while (0)
 #else