summaryrefslogtreecommitdiffstats
path: root/src/Data.cpp
diff options
context:
space:
mode:
authorGravatar Rosen Penev2020-12-21 22:09:42 -0800
committerGravatar Nikias Bassen2021-06-22 01:29:05 +0200
commitb086d0612740978c1942c1c3a078d4a0b8ffffef (patch)
tree46484950e8e6dbf2fb5d773a84b5bb73fc313bf7 /src/Data.cpp
parent526c10436caa894fb6139f4e6c0f73eebfa858ea (diff)
downloadlibplist-b086d0612740978c1942c1c3a078d4a0b8ffffef.tar.gz
libplist-b086d0612740978c1942c1c3a078d4a0b8ffffef.tar.bz2
[clang-tidy] cpp: Replace free with delete
It's the C++ way. It also avoids having to check for NULL. Found with cppcoreguidelines-owning-memory Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/Data.cpp')
-rw-r--r--src/Data.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Data.cpp b/src/Data.cpp
index 4515388..a96fc50 100644
--- a/src/Data.cpp
+++ b/src/Data.cpp
@@ -70,7 +70,7 @@ std::vector<char> Data::GetValue() const
uint64_t length = 0;
plist_get_data_val(_node, &buff, &length);
std::vector<char> ret(buff, buff + length);
- free(buff);
+ delete buff;
return ret;
}