rcx

library of miscellaneous bits of C code
git clone git://git.rr3.xyz/rcx
Log | Files | Refs | README | LICENSE

commit 5f8cf7ab2560fab8db1cdde6c7258e13c40bba17
parent fffb80f7fe99ba70ea6b49447bfbf92698d3454e
Author: Robert Russell <robertrussell.72001@gmail.com>
Date:   Tue, 13 Jun 2023 13:34:08 -0700

Make r_dict_free preserve errno

Diffstat:
Msrc/dict.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/dict.c b/src/dict.c @@ -301,10 +301,12 @@ r_dict_init(RDict *d, usize hint, RDictSpec *s) { void r_dict_free(RDict *d, RDictSpec *s) { + int e = errno; if (d->niter > 0) r_warnf("dict freed with %"PRId32" iterators alive", d->niter); s->free(d->mem); d->data = 0; /* Ensure hard error on use after free. */ + errno = e; } int