mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-16 21:29:59 +01:00
Fix memory leak in integrity resize api-test.
This commit is contained in:
committed by
Daniel Zaťovič
parent
1d6a445e43
commit
4cdcd908f4
@@ -1876,9 +1876,9 @@ static void ResizeIntegrity(void)
|
|||||||
EQ_(whole_device_size, r_size);
|
EQ_(whole_device_size, r_size);
|
||||||
GE_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
GE_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
||||||
OK_(crypt_deactivate(cd, CDEVICE_1));
|
OK_(crypt_deactivate(cd, CDEVICE_1));
|
||||||
|
CRYPT_FREE(cd);
|
||||||
|
|
||||||
// detached metadata
|
// detached metadata
|
||||||
OK_(crypt_init(&cd, DEVICE_2));
|
|
||||||
OK_(create_dmdevice_over_loop(H_DEVICE, 1024 * 1024 / 512));
|
OK_(create_dmdevice_over_loop(H_DEVICE, 1024 * 1024 / 512));
|
||||||
OK_(crypt_init_data_device(&cd, DMDIR H_DEVICE, DEVICE_2));
|
OK_(crypt_init_data_device(&cd, DMDIR H_DEVICE, DEVICE_2));
|
||||||
OK_(crypt_format(cd,CRYPT_INTEGRITY,NULL,NULL,NULL,NULL,0,¶ms));
|
OK_(crypt_format(cd,CRYPT_INTEGRITY,NULL,NULL,NULL,NULL,0,¶ms));
|
||||||
@@ -1896,8 +1896,8 @@ static void ResizeIntegrity(void)
|
|||||||
EQ_(whole_device_size, r_size);
|
EQ_(whole_device_size, r_size);
|
||||||
GE_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
GE_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
||||||
OK_(crypt_deactivate(cd, CDEVICE_1));
|
OK_(crypt_deactivate(cd, CDEVICE_1));
|
||||||
|
|
||||||
CRYPT_FREE(cd);
|
CRYPT_FREE(cd);
|
||||||
|
|
||||||
_cleanup_dmdevices();
|
_cleanup_dmdevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1955,9 +1955,9 @@ static void ResizeIntegrityWithKey(void)
|
|||||||
EQ_(whole_device_size, r_size);
|
EQ_(whole_device_size, r_size);
|
||||||
GE_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
GE_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
||||||
OK_(crypt_deactivate(cd, CDEVICE_1));
|
OK_(crypt_deactivate(cd, CDEVICE_1));
|
||||||
|
CRYPT_FREE(cd);
|
||||||
|
|
||||||
// detached metadata
|
// detached metadata
|
||||||
OK_(crypt_init(&cd, DEVICE_2));
|
|
||||||
OK_(create_dmdevice_over_loop(H_DEVICE, 1024 * 1024 / 512));
|
OK_(create_dmdevice_over_loop(H_DEVICE, 1024 * 1024 / 512));
|
||||||
OK_(crypt_init_data_device(&cd, DMDIR H_DEVICE, DEVICE_2));
|
OK_(crypt_init_data_device(&cd, DMDIR H_DEVICE, DEVICE_2));
|
||||||
OK_(crypt_format(cd,CRYPT_INTEGRITY,NULL,NULL,NULL,NULL,0,¶ms));
|
OK_(crypt_format(cd,CRYPT_INTEGRITY,NULL,NULL,NULL,NULL,0,¶ms));
|
||||||
@@ -1975,8 +1975,8 @@ static void ResizeIntegrityWithKey(void)
|
|||||||
EQ_(whole_device_size, r_size);
|
EQ_(whole_device_size, r_size);
|
||||||
GE_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
GE_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
||||||
OK_(crypt_deactivate(cd, CDEVICE_1));
|
OK_(crypt_deactivate(cd, CDEVICE_1));
|
||||||
|
|
||||||
CRYPT_FREE(cd);
|
CRYPT_FREE(cd);
|
||||||
|
|
||||||
_cleanup_dmdevices();
|
_cleanup_dmdevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user