Blame SOURCES/libfastjson-0.99.4-rhbz1421612-nullptr-guard.patch

5ff640
From 8793b9a1bda1d6e182a1118a6f1a0688f530a545 Mon Sep 17 00:00:00 2001
5ff640
From: Jiri Vymazal <jvymazal@redhat.com>
5ff640
Date: Thu, 2 Mar 2017 12:35:37 +0100
5ff640
Subject: [PATCH] add nullptr guard
5ff640
5ff640
---
5ff640
 json_object.c | 8 +++++---
5ff640
 1 file changed, 5 insertions(+), 3 deletions(-)
5ff640
5ff640
diff --git a/json_object.c b/json_object.c
5ff640
index b01782e..f8fc41b 100644
5ff640
--- a/json_object.c
5ff640
+++ b/json_object.c
5ff640
@@ -201,9 +201,11 @@ int fjson_object_put(struct fjson_object *jso)
5ff640
 
5ff640
 static void fjson_object_generic_delete(struct fjson_object* jso)
5ff640
 {
5ff640
-	printbuf_free(jso->_pb);
5ff640
-	DESTROY_ATOMIC_HELPER_MUT(jso->_mut_ref_count);
5ff640
-	free(jso);
5ff640
+	if (jso) {
5ff640
+		printbuf_free(jso->_pb);
5ff640
+		DESTROY_ATOMIC_HELPER_MUT(jso->_mut_ref_count);
5ff640
+		free(jso);
5ff640
+	}
5ff640
 }
5ff640
 
5ff640
 static struct fjson_object* fjson_object_new(const enum fjson_type o_type)