summaryrefslogtreecommitdiffstats
path: root/src/Key.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Key.cpp')
-rw-r--r--src/Key.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Key.cpp b/src/Key.cpp
index 8ba497a..5d7d372 100644
--- a/src/Key.cpp
+++ b/src/Key.cpp
@@ -67,13 +67,8 @@ std::string Key::GetValue() const
{
char* s = NULL;
plist_get_key_val(_node, &s);
- std::string ret;
- if (s) {
- ret = s;
- free(s);
- } else {
- ret = "";
- }
+ std::string ret = s ? s : "";
+ delete s;
return ret;
}