diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-05-19 23:22:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-19 23:22:44 +0200 |
commit | ed056c560b47f84a0aa0289151f4ec91f786d24a (patch) | |
tree | a6090ba19eae10a48a8bf0e446b991f16aa872c3 /src/shared/dissect-image.c | |
parent | Merge pull request #19603 from yuwata/network-link-get-by-name (diff) | |
parent | alloc-util: simplify GREEDY_REALLOC() logic by relying on malloc_usable_size() (diff) | |
download | systemd-ed056c560b47f84a0aa0289151f4ec91f786d24a.tar.xz systemd-ed056c560b47f84a0aa0289151f4ec91f786d24a.zip |
Merge pull request #19653 from poettering/greedy-realloc-more
malloc_usable_size() tweaks
Diffstat (limited to 'src/shared/dissect-image.c')
-rw-r--r-- | src/shared/dissect-image.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 3cf00adb6f..a8402c1dcd 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -1780,7 +1780,6 @@ typedef struct DecryptedPartition { struct DecryptedImage { DecryptedPartition *decrypted; size_t n_decrypted; - size_t n_allocated; }; #endif @@ -1876,7 +1875,7 @@ static int decrypt_partition( if (r < 0) return r; - if (!GREEDY_REALLOC0(d->decrypted, d->n_allocated, d->n_decrypted + 1)) + if (!GREEDY_REALLOC0(d->decrypted, d->n_decrypted + 1)) return -ENOMEM; r = sym_crypt_init(&cd, m->node); @@ -2028,7 +2027,7 @@ static int verity_partition( if (r < 0) return r; - if (!GREEDY_REALLOC0(d->decrypted, d->n_allocated, d->n_decrypted + 1)) + if (!GREEDY_REALLOC0(d->decrypted, d->n_decrypted + 1)) return -ENOMEM; /* If activating fails because the device already exists, check the metadata and reuse it if it matches. |