diff options
Diffstat (limited to 'src/pstore')
-rw-r--r-- | src/pstore/pstore.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c index 6ce38f10a3..81538d9cb3 100644 --- a/src/pstore/pstore.c +++ b/src/pstore/pstore.c @@ -101,7 +101,6 @@ typedef struct PStoreEntry { typedef struct PStoreList { PStoreEntry *entries; - size_t n_allocated; size_t n_entries; } PStoreList; @@ -208,7 +207,7 @@ static int write_dmesg(const char *dmesg, size_t size, const char *id) { static void process_dmesg_files(PStoreList *list) { /* Move files, reconstruct dmesg.txt */ _cleanup_free_ char *dmesg = NULL, *dmesg_id = NULL; - size_t dmesg_size = 0, dmesg_allocated = 0; + size_t dmesg_size = 0; bool dmesg_bad = false; PStoreEntry *pe; @@ -303,7 +302,7 @@ static void process_dmesg_files(PStoreList *list) { /* Reconstruction of dmesg is done as a useful courtesy: do not fail, but don't write garbled * output either. */ size_t needed = strlen(pe->dirent.d_name) + strlen(":\n") + pe->content_size + 1; - if (!GREEDY_REALLOC(dmesg, dmesg_allocated, dmesg_size + needed)) { + if (!GREEDY_REALLOC(dmesg, dmesg_size + needed)) { log_oom(); dmesg_bad = true; continue; @@ -348,7 +347,7 @@ static int list_files(PStoreList *list, const char *sourcepath) { continue; } - if (!GREEDY_REALLOC(list->entries, list->n_allocated, list->n_entries + 1)) + if (!GREEDY_REALLOC(list->entries, list->n_entries + 1)) return log_oom(); list->entries[list->n_entries++] = (PStoreEntry) { |