Don't mangle errno with free(3) if utrace(2) fails
This ensures POLA on FreeBSD (at least) as free(3) is generally assumed to not fiddle around with errno. Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
This commit is contained in:
parent
5135e34062
commit
6e6164ae15
@ -83,11 +83,13 @@ typedef struct {
|
||||
#ifdef JEMALLOC_UTRACE
|
||||
# define UTRACE(a, b, c) do { \
|
||||
if (opt_utrace) { \
|
||||
int utrace_serrno = errno; \
|
||||
malloc_utrace_t ut; \
|
||||
ut.p = (a); \
|
||||
ut.s = (b); \
|
||||
ut.r = (c); \
|
||||
utrace(&ut, sizeof(ut)); \
|
||||
errno = utrace_serrno; \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user