diff options
Diffstat (limited to 'src/jplist.c')
| -rw-r--r-- | src/jplist.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/jplist.c b/src/jplist.c index c29f760..d065f4d 100644 --- a/src/jplist.c +++ b/src/jplist.c @@ -480,6 +480,13 @@ plist_err_t plist_to_json_with_options(plist_t plist, char **plist_json, uint32_ str_buf_append(outbuf, "\0", 1); + if (!outbuf->data) { + str_buf_free(outbuf); + *plist_json = NULL; + *length = 0; + return PLIST_ERR_NO_MEM; + } + *plist_json = (char*)outbuf->data; *length = outbuf->len - 1; |
