diff options
author | Daniel Lockyer <thisisdaniellockyer@gmail.com> | 2017-11-24 11:33:41 +0100 |
---|---|---|
committer | Daniel Lockyer <thisisdaniellockyer@gmail.com> | 2017-11-24 11:33:41 +0100 |
commit | f9ecfd3bbed396d744373dd6c8876b7211eac594 (patch) | |
tree | 036c4d7498abc62984d3d1daf8e6eba080943da7 /src/import | |
parent | Replace free and return NULL with return mfree (diff) | |
download | systemd-f9ecfd3bbed396d744373dd6c8876b7211eac594.tar.xz systemd-f9ecfd3bbed396d744373dd6c8876b7211eac594.zip |
Replace free and reassignment with free_and_replace
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/import-raw.c | 4 | ||||
-rw-r--r-- | src/import/pull-raw.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c index 6f4313420a..f117c94da2 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -207,9 +207,7 @@ static int raw_import_maybe_convert_qcow2(RawImport *i) { } (void) unlink(i->temp_path); - free(i->temp_path); - i->temp_path = t; - t = NULL; + free_and_replace(i->temp_path, t); safe_close(i->output_fd); i->output_fd = converted_fd; diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index 8cab72495c..880cb84ba8 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -269,9 +269,7 @@ static int raw_pull_maybe_convert_qcow2(RawPull *i) { } (void) unlink(i->temp_path); - free(i->temp_path); - i->temp_path = t; - t = NULL; + free_and_replace(i->temp_path, t); safe_close(i->raw_job->disk_fd); i->raw_job->disk_fd = converted_fd; |