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, 7 insertions, 2 deletions
diff --git a/src/String.cpp b/src/String.cpp
index 09b47b5..0965349 100644
--- a/src/String.cpp
+++ b/src/String.cpp
@@ -67,8 +67,13 @@ std::string String::GetValue() const
{
char* s = NULL;
plist_get_string_val(_node, &s);
- std::string ret = s;
- free(s);
+ std::string ret;
+ if (s) {
+ ret = s;
+ free(s);
+ } else {
+ ret = "";
+ }
return ret;
}