summaryrefslogtreecommitdiffstats
path: root/ingen
diff options
context:
space:
mode:
Diffstat (limited to 'ingen')
-rw-r--r--ingen/filesystem.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/ingen/filesystem.hpp b/ingen/filesystem.hpp
index 19fa74b2..5c7d7568 100644
--- a/ingen/filesystem.hpp
+++ b/ingen/filesystem.hpp
@@ -73,7 +73,9 @@ inline bool create_directories(const FilePath& path)
inline FilePath current_path()
{
- std::unique_ptr<char> cpath(realpath(".", NULL));
+ struct Freer { void operator()(char* const ptr) { free(ptr); } };
+
+ std::unique_ptr<char, Freer> cpath(realpath(".", NULL));
const FilePath path(cpath.get());
return path;
}