diff options
Diffstat (limited to 'src/Key.cpp')
-rw-r--r-- | src/Key.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Key.cpp b/src/Key.cpp index e3ccbe6..ed0c0c6 100644 --- a/src/Key.cpp +++ b/src/Key.cpp @@ -67,8 +67,13 @@ std::string Key::GetValue() const { char* s = NULL; plist_get_key_val(_node, &s); - std::string ret = s; - free(s); + std::string ret; + if (s) { + ret = s; + free(s); + } else { + ret = ""; + } return ret; } |