From 2a3a313f83c11ee31480a6e4f77a82bfe4662701 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 27 Jun 2017 22:57:19 +0200 Subject: [PATCH] cJSON_PrintBuffered: Fix potential memory leak --- cJSON.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cJSON.c b/cJSON.c index aa6e563..4c12f20 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1111,6 +1111,7 @@ CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON if (!print_value(item, &p)) { + global_hooks.deallocate(p.buffer); return NULL; }