diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
commit | 8bb05ac73a5b448b339ce0bc8d396c82c459b47f (patch) | |
tree | 1fdda006866bca20d41cb206767ea5241e36852f /libblkid/src/partitions/partitions.c | |
parent | Adding debian version 2.39.3-11. (diff) | |
download | util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.tar.xz util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.zip |
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libblkid/src/partitions/partitions.c')
-rw-r--r-- | libblkid/src/partitions/partitions.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c index 8ebf480..e096cf8 100644 --- a/libblkid/src/partitions/partitions.c +++ b/libblkid/src/partitions/partitions.c @@ -436,8 +436,8 @@ static blkid_partition new_partition(blkid_partlist ls, blkid_parttable tab) /* Linux kernel has DISK_MAX_PARTS=256, but it's too much for * generic Linux machine -- let start with 32 partitions. */ - void *tmp = realloc(ls->parts, (ls->nparts_max + 32) * - sizeof(struct blkid_struct_partition)); + void *tmp = reallocarray(ls->parts, ls->nparts_max + 32, + sizeof(struct blkid_struct_partition)); if (!tmp) return NULL; ls->parts = tmp; @@ -557,6 +557,7 @@ static int idinfo_probe(blkid_probe pr, const struct blkid_idinfo *id, "%s: ---> call probefunc()", id->name)); errno = 0; rc = id->probefunc(pr, mag); + blkid_probe_prune_buffers(pr); if (rc < 0) { /* reset after error */ reset_partlist(blkid_probe_get_partlist(pr)); |