From edfac22f3939b4d19f6e6a208fb719aec4e51c20 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 28 Aug 2021 15:56:14 -0400 Subject: [PATCH] memory leak --- src/read_data.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/read_data.cpp b/src/read_data.cpp index 59958fe99f..6e16bbc58e 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -2052,6 +2052,7 @@ void ReadData::typelabels(std::vector &mytypelabel, int myntypes, i int eof = utils::read_lines_from_file(fp,myntypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); + char *original = buf; char *typelabel = new char[MAXLINE]; for (int i = 0; i < myntypes; i++) { next = strchr(buf,'\n'); @@ -2062,6 +2063,7 @@ void ReadData::typelabels(std::vector &mytypelabel, int myntypes, i mytypelabel[i] = typelabel; buf = next + 1; } + delete [] original; delete [] typelabel; // merge this read_data label map to atom class