OSDN Git Service

f2fs_utils: Alloc f2fs_journal
authorluca020400 <luca.stefani.ge1@gmail.com>
Mon, 11 Apr 2016 21:58:23 +0000 (23:58 +0200)
committerSteve Kondik <steve@cyngn.com>
Thu, 25 Aug 2016 00:32:19 +0000 (17:32 -0700)
* Fixes encryption

Change-Id: I542ae946bdc44d9c2e9c2dcfd50bbbf40f647b4b

f2fs_utils/f2fs_sparseblock.c

index 17552fb..433b132 100644 (file)
@@ -388,6 +388,13 @@ struct f2fs_info *generate_f2fs_info(int fd)
         return NULL;
     }
 
+    info->journal = calloc(1, sizeof(struct f2fs_journal));
+    if (!info->journal) {
+        SLOGE("Out of memory!");
+        free(info);
+        return NULL;
+    }
+
     sb = malloc(sizeof(*sb));
     if(!sb) {
         SLOGE("Out of memory!");
@@ -463,6 +470,9 @@ void free_f2fs_info(struct f2fs_info *info)
 
         free(info->sit_sums);
         info->sit_sums = NULL;
+
+        free(info->journal);
+        info->journal = NULL;
     }
     free(info);
 }