From 2250d5f71f9dd66112d5c63367169f4e6af8ad70 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 24 Jul 2014 11:37:24 +0200 Subject: [PATCH 1/3] Move safe table params wipe into function which allocates it. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/libdevmapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c index 3ed87c0..8e5a696 100644 --- a/lib/libdevmapper.c +++ b/lib/libdevmapper.c @@ -642,8 +642,6 @@ out_no_removal: if (cookie && _dm_use_udev()) (void)_dm_udev_wait(cookie); - if (params) - crypt_safe_free(params); if (dmt) dm_task_destroy(dmt); @@ -674,6 +672,8 @@ int dm_create_device(struct crypt_device *cd, const char *name, r = _dm_create_device(name, type, dmd->data_device, dmd->flags, dmd->uuid, dmd->size, table_params, reload); + + crypt_safe_free(table_params); dm_exit_context(); return r; } -- 2.0.1