summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/acpi-fpdt.c2
-rw-r--r--src/shared/boot-timestamps.c2
-rw-r--r--src/shared/efivars.c4
-rw-r--r--src/shared/sleep-config.c4
-rw-r--r--src/shared/socket-util.c2
-rw-r--r--src/shared/util.c2
6 files changed, 8 insertions, 8 deletions
diff --git a/src/shared/acpi-fpdt.c b/src/shared/acpi-fpdt.c
index 7bae47f85f..390c3236e0 100644
--- a/src/shared/acpi-fpdt.c
+++ b/src/shared/acpi-fpdt.c
@@ -83,7 +83,7 @@ struct acpi_fpdt_boot {
int acpi_get_boot_usec(usec_t *loader_start, usec_t *loader_exit) {
_cleanup_free_ char *buf = NULL;
struct acpi_table_header *tbl;
- size_t l;
+ size_t l = 0;
struct acpi_fpdt_header *rec;
int r;
uint64_t ptr = 0;
diff --git a/src/shared/boot-timestamps.c b/src/shared/boot-timestamps.c
index d656685774..54e0537a21 100644
--- a/src/shared/boot-timestamps.c
+++ b/src/shared/boot-timestamps.c
@@ -26,7 +26,7 @@
#include "efivars.h"
int boot_timestamps(const dual_timestamp *n, dual_timestamp *firmware, dual_timestamp *loader) {
- usec_t x, y, a;
+ usec_t x = 0, y = 0, a;
int r;
dual_timestamp _n;
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
index 000dae9de0..5ee8f1eb0b 100644
--- a/src/shared/efivars.c
+++ b/src/shared/efivars.c
@@ -130,7 +130,7 @@ int efi_get_variable(
int efi_get_variable_string(sd_id128_t vendor, const char *name, char **p) {
_cleanup_free_ void *s = NULL;
- size_t ss;
+ size_t ss = 0;
int r;
char *x;
@@ -393,7 +393,7 @@ fail:
static int read_usec(sd_id128_t vendor, const char *name, usec_t *u) {
_cleanup_free_ char *j = NULL;
int r;
- uint64_t x;
+ uint64_t x = 0;
assert(name);
assert(u);
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index b9b6643066..cf1cd400e8 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -220,8 +220,8 @@ static int hibernation_partition_size(size_t *size, size_t *used) {
static bool enough_memory_for_hibernation(void) {
_cleanup_free_ char *active = NULL;
- unsigned long long act;
- size_t size, used;
+ unsigned long long act = 0;
+ size_t size = 0, used = 0;
int r;
r = hibernation_partition_size(&size, &used);
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index 6d9c303529..5ef2e2244c 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -585,7 +585,7 @@ int getpeername_pretty(int fd, char **ret) {
return -errno;
if (sa.sa.sa_family == AF_UNIX) {
- struct ucred ucred;
+ struct ucred ucred = {};
/* UNIX connection sockets are anonymous, so let's use
* PID/UID as pretty credentials instead */
diff --git a/src/shared/util.c b/src/shared/util.c
index 55246f5a4d..35e4338c3a 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -5903,7 +5903,7 @@ int proc_cmdline(char **ret) {
int r;
if (detect_container(NULL) > 0) {
- char *buf, *p;
+ char *buf = NULL, *p;
size_t sz = 0;
r = read_full_file("/proc/1/cmdline", &buf, &sz);