From: Steve Grubb Date: Fri, 31 Jan 2025 05:58:55 +0000 (-0500) Subject: common: Add missing va_end (#11529) X-Git-Tag: upstream/0.0.4631~29 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=1bd3047a939e561adfb3c7dd2e17c4cc7a4e4e6f;p=pkg%2Fggml%2Fsources%2Fllama.cpp common: Add missing va_end (#11529) The va_copy man page states that va_end must be called to revert whatever the copy did. For some implementaions, not calling va_end has no consequences. For others it could leak memory. --- diff --git a/common/log.cpp b/common/log.cpp index 04c7c0ed..0b8994ae 100644 --- a/common/log.cpp +++ b/common/log.cpp @@ -206,6 +206,7 @@ public: vsnprintf(entry.msg.data(), entry.msg.size(), ss.str().c_str(), args_copy); } #endif + va_end(args_copy); } entry.level = level;