]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib: Preserve errno in our malloc() and free() wrappers main
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 26 Feb 2026 10:29:12 +0000 (12:29 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 26 Feb 2026 10:32:15 +0000 (12:32 +0200)
commitfd81e9b15d0c430e25e99e3c46f562d9cfb74efc
tree764423c758ff5d8d72327d25406df61995c3e984
parent450ca090c1ce4b339ed88d8819c28323cfa855dc
lib: Preserve errno in our malloc() and free() wrappers

Various places assume that e.g. t_strdup_printf() calls and such don't
modify errno. But because they internally call malloc() or calloc(), this
isn't actually guaranteed now and it can happen at least with newer glibc
versions. Explicitly preserve the errno for these calls where it might
be a problem.
src/lib/data-stack.c
src/lib/mempool-allocfree.c
src/lib/mempool-alloconly.c
src/lib/mempool-system.c