From c61e14d3a8412cd50d98aab604e607692c844c8a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 21:33:30 +0200 Subject: Adding upstream version 2.40. Signed-off-by: Daniel Baumann --- libblkid/src/partitions/partitions.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libblkid/src/partitions/partitions.c') 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)); -- cgit v1.2.3