Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 33d21c5

Browse files
lamb-jDavid Salinas
authored andcommitted
[Comgr] Fix issue in which Path memory freed before return
Previously we freed "Line" before returning. However the StringRef Path, which was built from the StringRef vector Tokens, depends on Line, instead of making a copy. Change-Id: I4861e0cca5c59458f731a7ecb523ac009d285bb0
1 parent e13ccf3 commit 33d21c5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/comgr/src/comgr-env.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ std::string getComgrInstallPathFromExecutable() {
137137
return "";
138138
}
139139

140+
std::string rv = StripGNUInstallLibDir(Path).str();
140141
fclose(ProcMaps);
141142
free(Line);
142-
return StripGNUInstallLibDir(Path).str();
143+
return rv;
143144
}
144145
}
145146

0 commit comments

Comments
 (0)