diff --git a/roaringbitmap.c b/roaringbitmap.c index 9ce1901..18e046b 100644 --- a/roaringbitmap.c +++ b/roaringbitmap.c @@ -292,6 +292,7 @@ roaringbitmap_out(PG_FUNCTION_ARGS) { serializedbytes = (bytea *) palloc(VARHDRSZ + expectedsize); roaring_bitmap_portable_serialize(r1, VARDATA(serializedbytes)); roaring_bitmap_free(r1); + SET_VARSIZE(serializedbytes, VARHDRSZ + expectedsize); return DirectFunctionCall1(byteaout, PointerGetDatum(serializedbytes)); }