diff --git a/src/core/dynamic-user.c b/src/core/dynamic-user.c index 921622d92c..eb4235637e 100644 --- a/src/core/dynamic-user.c +++ b/src/core/dynamic-user.c @@ -357,8 +357,8 @@ static int dynamic_user_realize( r = dynamic_user_pop(d, &num, &uid_lock_fd); if (r < 0) { - int new_uid_lock_fd; - uid_t new_uid; + int new_uid_lock_fd = -EBADF; /* avoid false maybe-uninitialized warning */ + uid_t new_uid = UID_INVALID; /* avoid false maybe-uninitialized warning */ if (r != -EAGAIN) return r; @@ -465,7 +465,7 @@ static int dynamic_user_realize( int dynamic_user_current(DynamicUser *d, uid_t *ret) { _cleanup_close_ int lock_fd = -EBADF; - uid_t uid; + uid_t uid = UID_INVALID; /* avoid false maybe-uninitialized warning */ int r; assert(d);