Securely erase before free() only dm_tasks marked as secure_data.
TODO: think about also using this for libdm/.
for (t = dmt->head; t; t = n) {
n = t->next;
- _dm_zfree_string(t->params);
+ if (dmt->secure_data)
+ _dm_zfree_string(t->params);
+ else
+ free(t->params);
free(t->type);
free(t);
}
void dm_task_destroy(struct dm_task *dmt)
{
_dm_task_free_targets(dmt);
- _dm_zfree_dmi(dmt->dmi.v4);
+ if (dmt->secure_data)
+ _dm_zfree_dmi(dmt->dmi.v4);
+ else
+ free(dmt->dmi.v4);
free(dmt->dev_name);
free(dmt->mangled_dev_name);
free(dmt->newname);