am ebc83b3e
: Merge "Fix memory leak in upgrade_crypt_ftr"
* commit 'ebc83b3e8ef6d0dbab84bec88e0231c7911e5378': Fix memory leak in upgrade_crypt_ftr
This commit is contained in:
commit
e22b21af3a
1 changed files with 2 additions and 0 deletions
|
@ -574,6 +574,7 @@ static void upgrade_crypt_ftr(int fd, struct crypt_mnt_ftr *crypt_ftr, off64_t o
|
||||||
/* Need to initialize the persistent data area */
|
/* Need to initialize the persistent data area */
|
||||||
if (lseek64(fd, pdata_offset, SEEK_SET) == -1) {
|
if (lseek64(fd, pdata_offset, SEEK_SET) == -1) {
|
||||||
SLOGE("Cannot seek to persisent data offset\n");
|
SLOGE("Cannot seek to persisent data offset\n");
|
||||||
|
free(pdata);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Write all zeros to the first copy, making it invalid */
|
/* Write all zeros to the first copy, making it invalid */
|
||||||
|
@ -588,6 +589,7 @@ static void upgrade_crypt_ftr(int fd, struct crypt_mnt_ftr *crypt_ftr, off64_t o
|
||||||
crypt_ftr->persist_data_offset[0] = pdata_offset;
|
crypt_ftr->persist_data_offset[0] = pdata_offset;
|
||||||
crypt_ftr->persist_data_offset[1] = pdata_offset + CRYPT_PERSIST_DATA_SIZE;
|
crypt_ftr->persist_data_offset[1] = pdata_offset + CRYPT_PERSIST_DATA_SIZE;
|
||||||
crypt_ftr->minor_version = 1;
|
crypt_ftr->minor_version = 1;
|
||||||
|
free(pdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((crypt_ftr->major_version == 1) && (crypt_ftr->minor_version == 1)) {
|
if ((crypt_ftr->major_version == 1) && (crypt_ftr->minor_version == 1)) {
|
||||||
|
|
Loading…
Reference in a new issue