summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/catalog.c2
-rw-r--r--src/journal/coredump.c4
-rw-r--r--src/journal/journal-file.c6
-rw-r--r--src/journal/journal-vacuum.c2
-rw-r--r--src/journal/journalctl.c2
-rw-r--r--src/journal/test-journal-stream.c2
6 files changed, 9 insertions, 9 deletions
diff --git a/src/journal/catalog.c b/src/journal/catalog.c
index e505a05305..0801e13599 100644
--- a/src/journal/catalog.c
+++ b/src/journal/catalog.c
@@ -558,7 +558,7 @@ static const char *find_id(void *p, sd_id128_t id) {
int catalog_get(const char* database, sd_id128_t id, char **_text) {
_cleanup_close_ int fd = -1;
void *p = NULL;
- struct stat st;
+ struct stat st = {};
char *text = NULL;
int r;
const char *s;
diff --git a/src/journal/coredump.c b/src/journal/coredump.c
index 6357d3e277..4e23e487fb 100644
--- a/src/journal/coredump.c
+++ b/src/journal/coredump.c
@@ -242,7 +242,7 @@ static int maybe_remove_external_coredump(const char *filename, off_t size) {
static int make_filename(const char *info[_INFO_LEN], char **ret) {
_cleanup_free_ char *c = NULL, *u = NULL, *p = NULL, *t = NULL;
- sd_id128_t boot;
+ sd_id128_t boot = {};
int r;
assert(info);
@@ -841,7 +841,7 @@ log:
/* Optionally store the entire coredump in the journal */
if (IN_SET(arg_storage, COREDUMP_STORAGE_JOURNAL, COREDUMP_STORAGE_BOTH) &&
coredump_size <= (off_t) arg_journal_size_max) {
- size_t sz;
+ size_t sz = 0;
/* Store the coredump itself in the journal */
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 8e7642710e..5a4e7cbd7d 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -887,7 +887,7 @@ int journal_file_find_data_object_with_hash(
if (o->object.flags & OBJECT_COMPRESSION_MASK) {
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
uint64_t l;
- size_t rsize;
+ size_t rsize = 0;
l = le64toh(o->object.size);
if (l <= offsetof(Object, data.payload))
@@ -1052,7 +1052,7 @@ static int journal_file_append_data(
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
if (f->compress_xz &&
size >= COMPRESSION_SIZE_THRESHOLD) {
- size_t rsize;
+ size_t rsize = 0;
compression = compress_blob(data, size, o->data.payload, &rsize);
@@ -2886,7 +2886,7 @@ int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6
if (o->object.flags & OBJECT_COMPRESSION_MASK) {
#if defined(HAVE_XZ) || defined(HAVE_LZ4)
- size_t rsize;
+ size_t rsize = 0;
r = decompress_blob(o->object.flags & OBJECT_COMPRESSION_MASK,
o->data.payload, l, &from->compress_buffer, &from->compress_buffer_size, &rsize, 0);
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c
index a367dc1bb9..81a577ea27 100644
--- a/src/journal/journal-vacuum.c
+++ b/src/journal/journal-vacuum.c
@@ -73,7 +73,7 @@ static void patch_realtime(
unsigned long long *realtime) {
_cleanup_free_ const char *path = NULL;
- usec_t x, crtime;
+ usec_t x, crtime = 0;
/* The timestamp was determined by the file name, but let's
* see if the file might actually be older than the file name
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 7fbd518d3f..b4f88bcd0a 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -1487,7 +1487,7 @@ static int verify(sd_journal *j) {
ORDERED_HASHMAP_FOREACH(f, j->files, i) {
int k;
- usec_t first, validated, last;
+ usec_t first = 0, validated = 0, last = 0;
#ifdef HAVE_GCRYPT
if (!arg_verify_key && JOURNAL_HEADER_SEALED(f->header))
diff --git a/src/journal/test-journal-stream.c b/src/journal/test-journal-stream.c
index 3996e778e6..b8caeb3d41 100644
--- a/src/journal/test-journal-stream.c
+++ b/src/journal/test-journal-stream.c
@@ -42,7 +42,7 @@ static void verify_contents(sd_journal *j, unsigned skip) {
const void *d;
char *k, *c;
size_t l;
- unsigned u;
+ unsigned u = 0;
assert_se(sd_journal_get_cursor(j, &k) >= 0);
printf("cursor: %s\n", k);