fstab-generator: add missing assertions

This commit is contained in:
Mike Yuan
2024-01-23 22:40:17 +08:00
parent 4c7cc69652
commit 27db64bce8

View File

@@ -191,6 +191,8 @@ static int mount_array_add_swap(bool for_initrd, const char *str) {
static int write_options(FILE *f, const char *options) {
_cleanup_free_ char *o = NULL;
assert(f);
if (isempty(options))
return 0;
@@ -208,6 +210,9 @@ static int write_options(FILE *f, const char *options) {
static int write_what(FILE *f, const char *what) {
_cleanup_free_ char *w = NULL;
assert(f);
assert(what);
w = specifier_escape(what);
if (!w)
return log_oom();