summaryrefslogtreecommitdiffstats
path: root/src/out-plutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/out-plutil.c')
-rw-r--r--src/out-plutil.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/out-plutil.c b/src/out-plutil.c
index e603f31..ef17b7c 100644
--- a/src/out-plutil.c
+++ b/src/out-plutil.c
@@ -443,6 +443,13 @@ plist_err_t plist_write_to_string_plutil(plist_t plist, char **output, uint32_t*
}
str_buf_append(outbuf, "\0", 1);
+ if (!outbuf->data) {
+ str_buf_free(outbuf);
+ *output = NULL;
+ *length = 0;
+ return PLIST_ERR_NO_MEM;
+ }
+
*output = (char*)outbuf->data;
*length = outbuf->len - 1;