From 0aef861365123e6d6ba792013dc2e1209b9fa600 Mon Sep 17 00:00:00 2001 From: luca020400 Date: Mon, 11 Apr 2016 23:58:23 +0200 Subject: [PATCH] f2fs_utils: Alloc f2fs_journal * Fixes encryption Change-Id: I542ae946bdc44d9c2e9c2dcfd50bbbf40f647b4b --- f2fs_utils/f2fs_sparseblock.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/f2fs_utils/f2fs_sparseblock.c b/f2fs_utils/f2fs_sparseblock.c index 17552fb5..433b1329 100644 --- a/f2fs_utils/f2fs_sparseblock.c +++ b/f2fs_utils/f2fs_sparseblock.c @@ -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); } -- 2.11.0