From 5867b7331d75c5dfc8ca1f02d3dcd14017518558 Mon Sep 17 00:00:00 2001 From: Hinko Kocevar Date: Thu, 28 Mar 2019 17:25:36 +0100 Subject: [PATCH] plug memory leak ==21315== 4,000 bytes in 1,000 blocks are definitely lost in loss record 6,503 of 6,903 ==21315== at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==21315== by 0x510CE7E: NDFileHDF5::createAttributeDataset(NDArray*) (NDFileHDF5.cpp:2652) ==21315== by 0x510E7C9: NDFileHDF5::openFile(char const*, int, NDArray*) (NDFileHDF5.cpp:282) ==21315== by 0x50FDEF5: NDPluginFile::openFileBase(int, NDArray*) (NDPluginFile.cpp:73) .. --- ADApp/pluginSrc/NDFileHDF5.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ADApp/pluginSrc/NDFileHDF5.cpp b/ADApp/pluginSrc/NDFileHDF5.cpp index 4cb73e869..648e96eee 100644 --- a/ADApp/pluginSrc/NDFileHDF5.cpp +++ b/ADApp/pluginSrc/NDFileHDF5.cpp @@ -2765,6 +2765,9 @@ asynStatus NDFileHDF5::createAttributeDataset(NDArray *pArray) if(def_group != NULL){ H5Gclose(groupDefault); } + if (numCapture) { + free(numCapture); + } return asynSuccess; }