From: Paul Floyd Date: Sun, 28 Apr 2024 16:19:55 +0000 (+0200) Subject: fd leaks: add an assert for the error extra data X-Git-Tag: VALGRIND_3_24_0~168 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae61874628b24eca475137a581500cf06882c83c;p=thirdparty%2Fvalgrind.git fd leaks: add an assert for the error extra data Coverity claims that it could cause a NULL dereference. I don't think it's possible. Adding an assert will at least make things clearer if Coverity ever turns out to be right. --- diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 0c0f67602..48be8e8bf 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -1128,6 +1128,7 @@ void fd_pp_Error (const Error *err) if (xml) VG_(emit)(" FdBadClose\n"); struct BadCloseExtra *bce = (struct BadCloseExtra *) VG_(get_error_extra)(err); + vg_assert(bce); if (xml) { VG_(emit)(" %d\n", bce->fd); if (bce->pathname)