sd_id128_t seed;
char *node;
+ bool node_is_our_file;
int backing_fd;
bool from_scratch;
fdisk_unref_context(context->fdisk_context);
safe_close(context->backing_fd);
- free(context->node);
+ if (context->node_is_our_file)
+ unlink_and_free(context->node);
+ else
+ free(context->node);
return mfree(context);
}
return log_error_errno(errno, "Failed to create '%s': %m", arg_node);
context->node = TAKE_PTR(s);
+ context->node_is_our_file = true;
context->backing_fd = TAKE_FD(fd);
return 0;
}
(void) context_dump(context, /*late=*/ true);
+ context->node = mfree(context->node);
+
LIST_FOREACH(partitions, p, context->partitions)
p->split_path = mfree(p->split_path);