Displaying 2 results from an estimated 2 matches for "2cc625c".
2019 Sep 15
0
[PATCH nbdkit v2] common/bitmap: Don't fail on realloc (ptr, 0)
...Thanks: Eric Blake
---
common/bitmap/bitmap.c | 14 ++++++++++----
tests/Makefile.am | 2 ++
tests/test-cow-null.sh | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/common/bitmap/bitmap.c b/common/bitmap/bitmap.c
index caac916..2cc625c 100644
--- a/common/bitmap/bitmap.c
+++ b/common/bitmap/bitmap.c
@@ -59,10 +59,16 @@ bitmap_resize (struct bitmap *bm, uint64_t new_size)
}
new_bm_size = (size_t) new_bm_size_u64;
- new_bitmap = realloc (bm->bitmap, new_bm_size);
- if (new_bitmap == NULL) {
- nbdkit_error ("rea...
2019 Sep 15
2
[PATCH nbdkit v2] common/bitmap: Don't fail on realloc (ptr, 0)
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00100.html
In v2 I've changed the patch so it avoids calling realloc at all in
this case.
The patch is a bit longer this way. But I don't see any other
alternative if we are to avoid having a "realloc wrapper" of some kind
that we use everywhere, which I guess we should avoid because it makes
plugins