chdman: fixed deletion of output file in case of an error (nw)

This commit is contained in:
Oliver Stöneberg 2013-06-21 17:21:43 +00:00
parent 5363a89597
commit 54e9da3266

View File

@ -1635,11 +1635,11 @@ static void do_create_raw(parameters_t &params)
} }
catch (...) catch (...)
{ {
delete chd;
// delete the output file // delete the output file
astring *output_chd_str = params.find(OPTION_OUTPUT); astring *output_chd_str = params.find(OPTION_OUTPUT);
if (output_chd_str != NULL) if (output_chd_str != NULL)
osd_rmfile(*output_chd_str); osd_rmfile(*output_chd_str);
delete chd;
throw; throw;
} }
} }
@ -1808,11 +1808,11 @@ static void do_create_hd(parameters_t &params)
} }
catch (...) catch (...)
{ {
delete chd;
// delete the output file // delete the output file
astring *output_chd_str = params.find(OPTION_OUTPUT); astring *output_chd_str = params.find(OPTION_OUTPUT);
if (output_chd_str != NULL) if (output_chd_str != NULL)
osd_rmfile(*output_chd_str); osd_rmfile(*output_chd_str);
delete chd;
throw; throw;
} }
} }
@ -1900,11 +1900,11 @@ static void do_create_cd(parameters_t &params)
} }
catch (...) catch (...)
{ {
delete chd;
// delete the output file // delete the output file
astring *output_chd_str = params.find(OPTION_OUTPUT); astring *output_chd_str = params.find(OPTION_OUTPUT);
if (output_chd_str != NULL) if (output_chd_str != NULL)
osd_rmfile(*output_chd_str); osd_rmfile(*output_chd_str);
delete chd;
throw; throw;
} }
} }
@ -2025,11 +2025,11 @@ static void do_create_ld(parameters_t &params)
} }
catch (...) catch (...)
{ {
delete chd;
// delete the output file // delete the output file
astring *output_chd_str = params.find(OPTION_OUTPUT); astring *output_chd_str = params.find(OPTION_OUTPUT);
if (output_chd_str != NULL) if (output_chd_str != NULL)
osd_rmfile(*output_chd_str); osd_rmfile(*output_chd_str);
delete chd;
throw; throw;
} }
} }
@ -2150,11 +2150,11 @@ static void do_copy(parameters_t &params)
} }
catch (...) catch (...)
{ {
delete chd;
// delete the output file // delete the output file
astring *output_chd_str = params.find(OPTION_OUTPUT); astring *output_chd_str = params.find(OPTION_OUTPUT);
if (output_chd_str != NULL) if (output_chd_str != NULL)
osd_rmfile(*output_chd_str); osd_rmfile(*output_chd_str);
delete chd;
throw; throw;
} }
} }