]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common: Add missing va_end (#11529)
authorSteve Grubb <redacted>
Fri, 31 Jan 2025 05:58:55 +0000 (00:58 -0500)
committerGitHub <redacted>
Fri, 31 Jan 2025 05:58:55 +0000 (07:58 +0200)
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.

common/log.cpp

index 04c7c0ed10595e35eecd79f66d43e21990bde6c4..0b8994ae1c520e414467592b7886b9bb2ffc665d 100644 (file)
@@ -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;