ethereum / c-kzg-4844

A minimal implementation of the Polynomial Commitments API for EIP-4844 and EIP-7594, written in C.

Repository from Github https://github.comethereum/c-kzg-4844Repository from Github https://github.comethereum/c-kzg-4844

free_trusted_setup should also free `s`

asn-d6 opened this issue · comments

Is there a reason we are not also freeing the pointer s in free_trusted_setup() and the bindings need to do it themselves?

We don't allocate that pointer, so it would be "rude" to free it. It's just a convention where whoever allocates a pointer is responsible for freeing it.

I see. That's because load_trusted_setup() takes the pointer as input instead of producing it itself.

Makes sense. Let's close this for now. Thanks!

We should check that all bindings free the pointer correctly since it's a bit counter-intuitive.