[Libreoffice-commits] online.git: test/test.cpp

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 12 09:44:18 UTC 2019


 test/test.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e310e76cfc4e07aeb09d48808e7654bc2650c305
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Sep 12 11:43:49 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Sep 12 11:43:49 2019 +0200

    test: fix memory leak
    
    ==18134==ERROR: LeakSanitizer: detected memory leaks
    
    Direct leak of 8 byte(s) in 1 object(s) allocated from:
        #0 0x514db8 in operator new(unsigned long) /git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_new_delete.cc:105
        #1 0x9f836c in runClientTests(bool, bool) /git/libreoffice/online-san/test/test.cpp:113:28
        #2 0x9f7975 in main /git/libreoffice/online-san/test/test.cpp:77:12
    
    Change-Id: Ib93625e2a77e37733b9bb052dd73ec3333bc2a71

diff --git a/test/test.cpp b/test/test.cpp
index 621ff6351..f5824b1d1 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -14,6 +14,7 @@
 
 #include <cstdlib>
 #include <iostream>
+#include <memory>
 
 #include <cppunit/BriefTestProgressListener.h>
 #include <cppunit/CompilerOutputter.h>
@@ -110,7 +111,8 @@ bool runClientTests(bool standalone, bool verbose)
     controller.addListener(&result);
     CPPUNIT_NS::BriefTestProgressListener progress;
     controller.addListener(&progress);
-    controller.addListener(new CPPUNIT_NS::TextTestProgressListener());
+    CPPUNIT_NS::TextTestProgressListener listener;
+    controller.addListener(&listener);
 
     CPPUNIT_NS::Test* testRegistry = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
 


More information about the Libreoffice-commits mailing list