]> git.ipfire.org Git - thirdparty/gcc.git/commit
libiberty: Make `objalloc_free' `free'-like WRT null pointer
authorMaciej W. Rozycki <macro@redhat.com>
Mon, 12 Jan 2026 13:08:28 +0000 (13:08 +0000)
committerMaciej W. Rozycki <macro@redhat.com>
Mon, 12 Jan 2026 13:08:28 +0000 (13:08 +0000)
commit0c775dcf3e78148204b78022dfd3de4a0833f496
tree66e9b0b2143c75fd8621776ef207259d2f1ec386
parent392035010fb8fe23e50efcec9ff71207d0754a36
libiberty: Make `objalloc_free' `free'-like WRT null pointer

Inspired by a suggestion from Jan Beulich to make one of `objalloc_free'
callers `free'-like with respect to null pointer argument handling make
the function return with no action taken rather than crashing when such
a pointer is passed.  This is to make the API consistent with ISO C and
to relieve all the callers from having to check for a null pointer.

libiberty/
* objalloc.c (objalloc_free): Don't use the pointer passed if
null.
libiberty/objalloc.c