From 0680b529874b701b20650586d8466a155d9ba0d5 Mon Sep 17 00:00:00 2001 From: Daniel Vassdal Date: Sun, 24 Nov 2013 16:04:32 -0800 Subject: Fix issues discovered by Coverity - Fix resource leak in InspIRCd::Format() - Explicitly set NewServices to NULL before the object it points to goes out of scope --- src/helperfuncs.cpp | 2 ++ src/modules.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 590b993d1..1899ce1b3 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -400,6 +400,8 @@ const char* InspIRCd::Format(va_list &vaList, const char* formatString) va_copy(dst, vaList); int vsnret = vsnprintf(&formatBuffer[0], formatBuffer.size(), formatString, dst); + va_end(dst); + if (vsnret > 0 && static_cast(vsnret) < formatBuffer.size()) { return &formatBuffer[0]; diff --git a/src/modules.cpp b/src/modules.cpp index 92f619743..2157d1948 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -550,6 +550,8 @@ void ModuleManager::LoadAll() } } + this->NewServices = NULL; + if (!PrioritizeHooks()) ServerInstance->Exit(EXIT_STATUS_MODULE); } -- cgit v1.2.3