BPathFinder: Fix leak of paths from find_paths.
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <PathFinder.h>
|
#include <PathFinder.h>
|
||||||
|
|
||||||
|
#include <AutoDeleter.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <StringList.h>
|
#include <StringList.h>
|
||||||
@@ -128,6 +129,8 @@ BPathFinder::FindPaths(const char* architecture,
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
MemoryDeleter pathArrayDeleter(pathArray);
|
||||||
|
|
||||||
// add them to BStringList
|
// add them to BStringList
|
||||||
for (size_t i = 0; i < pathCount; i++) {
|
for (size_t i = 0; i < pathCount; i++) {
|
||||||
BString path(pathArray[i]);
|
BString path(pathArray[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user