Merge "Fix memory leak in upgrade_crypt_ftr"
diff --git a/cryptfs.c b/cryptfs.c
index 61c0490..1f02a14 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -568,6 +568,7 @@
/* Need to initialize the persistent data area */
if (lseek64(fd, pdata_offset, SEEK_SET) == -1) {
SLOGE("Cannot seek to persisent data offset\n");
+ free(pdata);
return;
}
/* Write all zeros to the first copy, making it invalid */
@@ -582,6 +583,7 @@
crypt_ftr->persist_data_offset[0] = pdata_offset;
crypt_ftr->persist_data_offset[1] = pdata_offset + CRYPT_PERSIST_DATA_SIZE;
crypt_ftr->minor_version = 1;
+ free(pdata);
}
if ((crypt_ftr->major_version == 1) && (crypt_ftr->minor_version == 1)) {