BPathFinder: Fix leak of paths from find_paths.
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user