diff options
author | David Robillard <d@drobilla.net> | 2018-01-21 14:22:49 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-01-21 14:22:49 +0100 |
commit | 64de386aea724126e70c5186fe5e0166e0a79d35 (patch) | |
tree | aa28d684698849d11dc4d686b173fe5d5c13c3b0 /ingen/filesystem.hpp | |
parent | 2d120598cbe5b935c6ab514685583dc506758026 (diff) | |
download | ingen-64de386aea724126e70c5186fe5e0166e0a79d35.tar.gz ingen-64de386aea724126e70c5186fe5e0166e0a79d35.tar.bz2 ingen-64de386aea724126e70c5186fe5e0166e0a79d35.zip |
Fix mismatched malloc/delete
Diffstat (limited to 'ingen/filesystem.hpp')
-rw-r--r-- | ingen/filesystem.hpp | 4 |
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; } |