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