From 54e9da32660b5ad3fa7b189de1bf1cf60f669022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Fri, 21 Jun 2013 17:21:43 +0000 Subject: [PATCH] chdman: fixed deletion of output file in case of an error (nw) --- src/tools/chdman.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tools/chdman.c b/src/tools/chdman.c index d84d4760010..2f49b47f217 100644 --- a/src/tools/chdman.c +++ b/src/tools/chdman.c @@ -1635,11 +1635,11 @@ static void do_create_raw(parameters_t ¶ms) } catch (...) { + delete chd; // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) osd_rmfile(*output_chd_str); - delete chd; throw; } } @@ -1808,11 +1808,11 @@ static void do_create_hd(parameters_t ¶ms) } catch (...) { + delete chd; // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) osd_rmfile(*output_chd_str); - delete chd; throw; } } @@ -1900,11 +1900,11 @@ static void do_create_cd(parameters_t ¶ms) } catch (...) { + delete chd; // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) osd_rmfile(*output_chd_str); - delete chd; throw; } } @@ -2025,11 +2025,11 @@ static void do_create_ld(parameters_t ¶ms) } catch (...) { + delete chd; // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) osd_rmfile(*output_chd_str); - delete chd; throw; } } @@ -2150,11 +2150,11 @@ static void do_copy(parameters_t ¶ms) } catch (...) { + delete chd; // delete the output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) osd_rmfile(*output_chd_str); - delete chd; throw; } }