mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
tree-wide: Fix -Wmaybe-uninitialized compilation warnings
(cherry picked from commit 7e48f3ba71
)
This commit is contained in:
parent
699666e94d
commit
550cd149c1
@ -601,7 +601,7 @@ static int fs_validate(
|
||||
sd_id128_t *ret_found_uuid) {
|
||||
|
||||
_cleanup_free_ char *fstype = NULL;
|
||||
sd_id128_t u;
|
||||
sd_id128_t u = SD_ID128_NULL; /* avoid false maybe-unitialized warning */
|
||||
int r;
|
||||
|
||||
assert(dm_node);
|
||||
|
@ -171,7 +171,7 @@ static int enumerate_print_list(struct udev_enumerate *enumerate) {
|
||||
}
|
||||
|
||||
static void test_monitor(struct udev *udev) {
|
||||
_cleanup_(udev_monitor_unrefp) struct udev_monitor *udev_monitor;
|
||||
_cleanup_(udev_monitor_unrefp) struct udev_monitor *udev_monitor = NULL;
|
||||
_cleanup_close_ int fd_ep = -EBADF;
|
||||
int fd_udev;
|
||||
struct epoll_event ep_udev = {
|
||||
|
@ -11,8 +11,8 @@ static void test_unit_escape_setting_one(
|
||||
const char *expected_exec,
|
||||
const char *expected_c) {
|
||||
|
||||
_cleanup_free_ char *a = NULL, *b, *c, *d,
|
||||
*s_esc, *a_esc, *b_esc, *c_esc, *d_esc;
|
||||
_cleanup_free_ char *a = NULL, *b = NULL, *c = NULL, *d = NULL,
|
||||
*s_esc = NULL, *a_esc = NULL, *b_esc = NULL, *c_esc = NULL, *d_esc = NULL;
|
||||
const char *t;
|
||||
|
||||
if (!expected_exec_env)
|
||||
@ -66,8 +66,8 @@ static void test_unit_concat_strv_one(
|
||||
const char *expected_exec,
|
||||
const char *expected_c) {
|
||||
|
||||
_cleanup_free_ char *a, *b, *c, *d,
|
||||
*s_ser, *s_esc, *a_esc, *b_esc, *c_esc, *d_esc;
|
||||
_cleanup_free_ char *a = NULL, *b = NULL, *c = NULL, *d = NULL,
|
||||
*s_ser = NULL, *s_esc = NULL, *a_esc = NULL, *b_esc = NULL, *c_esc = NULL, *d_esc = NULL;
|
||||
|
||||
assert_se(s_ser = strv_join(s, "_"));
|
||||
assert_se(s_esc = cescape(s_ser));
|
||||
|
@ -137,7 +137,7 @@ TEST(ellipsize_ansi) {
|
||||
}
|
||||
|
||||
TEST(ellipsize_ansi_cats) {
|
||||
_cleanup_free_ char *e, *f, *g, *h;
|
||||
_cleanup_free_ char *e = NULL, *f = NULL, *g = NULL, *h = NULL;
|
||||
|
||||
/* Make sure we don't cut off in the middle of an ANSI escape sequence. */
|
||||
|
||||
|
@ -260,7 +260,7 @@ TEST(real_pressure) {
|
||||
assert_se(sd_event_source_set_memory_pressure_period(es, 70 * USEC_PER_MSEC, USEC_PER_SEC) == 0);
|
||||
assert_se(sd_event_source_set_enabled(es, SD_EVENT_ONESHOT) >= 0);
|
||||
|
||||
_cleanup_free_ char *uo;
|
||||
_cleanup_free_ char *uo = NULL;
|
||||
assert_se(uo = unit_dbus_path_from_name(scope));
|
||||
|
||||
uint64_t mcurrent = UINT64_MAX;
|
||||
|
Loading…
Reference in New Issue
Block a user