Re: [PATCH v4 00/25] reftable: handle allocation errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 01, 2024 at 12:25:02PM -0700, Junio C Hamano wrote:
> René Scharfe <l.s.r@xxxxxx> writes:
> 
> > Am 01.10.24 um 19:52 schrieb Junio C Hamano:
> >> Shouldn't we add FREE_AND_NULL() to the banned list as well in the
> >> last step?
> >
> > And perhaps the wrapper.h functions like xmalloc()?  At least as long as
> > git-compat-util.h is included by reftable/system.h.  Can be done later,
> > of course, no need to reroll just for that.
> 
> Yeah, and I agree FREE_AND_NULL() falls into the same bucket as xmalloc()
> and friends, so no need to reroll just for that, either.

`FREE_AND_NULL()` would already be detected because it expands to code
that contains `free()`. Same for `REALLOC_ARRAY()` and the likes.

I'm overall a bit more hesitant to also start banning all the Git
specific wrappers, mostly because there are so many of them. My goal is
to rather make them inaccessible in the "reftable/" code in the first
place so that we don't have to play whack-a-mole. My plan here is to
split out the POSIX-providing bits from "git-compat-util.h" into a new
header "compat/posix.h" that we can include in "reftable/system.h".

But it'll take a while to get there :)

Thanks for your inputs!

Patrick




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux