Another batch of fixes (mostly) generated by Coccinelle.
#include <sys/types.h>
#include <unistd.h>
+#include "alloc-util.h"
#include "errno-util.h"
#include "time-util.h"
return NULL;
(void) rmdir(p);
- free(p);
- return NULL;
+ return mfree(p);
}
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rmdir_and_free);
return NULL;
(void) unlink_noerrno(p);
- free(p);
- return NULL;
+ return mfree(p);
}
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, unlink_and_free);
#include <sys/stat.h>
+#include "alloc-util.h"
#include "errno-util.h"
typedef enum RemoveFlags {
return NULL;
(void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_MISSING_OK|REMOVE_CHMOD);
- free(p);
- return NULL;
+ return mfree(p);
}
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rm_rf_physical_and_free);
return NULL;
(void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME|REMOVE_MISSING_OK|REMOVE_CHMOD);
- free(p);
- return NULL;
+ return mfree(p);
}
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rm_rf_subvolume_and_free);
};
}
- if (ns_info->private_ipc) {
+ if (ns_info->private_ipc)
*(m++) = (MountEntry) {
.path_const = "/dev/mqueue",
.mode = MQUEUEFS,
.flags = MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_RELATIME,
};
- }
if (creds_path) {
/* If our service has a credentials store configured, then bind that one in, but hide
if (setup_propagate)
(void) mkdir_p(propagate_dir, 0600);
- if (n_extension_images > 0) {
+ if (n_extension_images > 0)
/* ExtensionImages mountpoint directories will be created
* while parsing the mounts to create, so have the parent ready */
(void) mkdir_p(extension_dir, 0600);
- }
/* Remount / as SLAVE so that nothing now mounted in the namespace
* shows up in the parent */
return 0;
}
- if (k/1000/100 > UINT32_MAX) {
+ if (k/1000/100 > UINT32_MAX)
log_syntax(unit, LOG_WARNING, filename, line, 0,
"The value of '%s=', is outside of 0...429496729500000 range: %s",
lvalue, rvalue);
- }
*bandwidth = k/1000/100;
assert_se(read_one_line_file("/proc/version", &a) >= 0);
assert_se(read_one_line_file(f, &b) >= 0);
assert_se(streq(a, b));
- assert_se(strlen(a) > 0);
+ assert_se(!isempty(a));
}
int main(int argc, char *argv[]) {
if (r < 0)
return log_error_errno(r, "Failed to generate unit name: %m");
- options_escaped = specifier_escape(arg_options ?: "");
+ options_escaped = specifier_escape(strempty(arg_options));
if (!options_escaped)
return log_oom();