BPathFinder: Fix leak of paths from find_paths.

This commit is contained in:
Michael Lotz
2015-04-10 14:41:26 +02:00
parent baa27ccb30
commit 058d3b8267
+3
View File
@@ -6,6 +6,7 @@
#include <PathFinder.h>
#include <AutoDeleter.h>
#include <FindDirectory.h>
#include <Path.h>
#include <StringList.h>
@@ -128,6 +129,8 @@ BPathFinder::FindPaths(const char* architecture,
if (error != B_OK)
return error;
MemoryDeleter pathArrayDeleter(pathArray);
// add them to BStringList
for (size_t i = 0; i < pathCount; i++) {
BString path(pathArray[i]);