Replace free and reassignment with free_and_replace

This commit is contained in:
Daniel Lockyer
2017-11-24 10:33:41 +00:00
parent 5fecf46d76
commit f9ecfd3bbe
12 changed files with 21 additions and 64 deletions
+2 -7
View File
@@ -649,13 +649,8 @@ int image_rename(Image *i, const char *new_name) {
if (file_attr & FS_IMMUTABLE_FL)
(void) chattr_path(new_path, FS_IMMUTABLE_FL, FS_IMMUTABLE_FL);
free(i->path);
i->path = new_path;
new_path = NULL;
free(i->name);
i->name = nn;
nn = NULL;
free_and_replace(i->path, new_path);
free_and_replace(i->name, nn);
STRV_FOREACH(j, settings) {
r = rename_auxiliary_file(*j, new_name, ".nspawn");