代码拉取完成,页面将自动刷新
From 828c12b22661de53d6497bd1410c68cb153b4f35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Wed, 6 Nov 2024 15:19:04 +0100
Subject: [PATCH] Handle NULL gracefully in json_tokener_free
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Similarly to glibc's free, make json_tokener_free(NULL)
a no-op, to simplify cleanup paths.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
json_tokener.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/json_tokener.c b/json_tokener.c
index c831f8a..4453c89 100644
--- a/json_tokener.c
+++ b/json_tokener.c
@@ -182,6 +182,8 @@ struct json_tokener *json_tokener_new(void)
void json_tokener_free(struct json_tokener *tok)
{
+ if (!tok)
+ return;
json_tokener_reset(tok);
if (tok->pb)
printbuf_free(tok->pb);
--
2.35.1.windows.2
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。