From f4e048b07e8b5a3e7bed9b93860683deab1d7d05 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Mon, 7 Oct 2024 13:00:48 -0300 Subject: [PATCH] remove gvm_json_pull_event_reset() because duplicates gvm_json_pull_event_cleanup() --- util/jsonpull.c | 16 +--------------- util/jsonpull.h | 3 --- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/util/jsonpull.c b/util/jsonpull.c index 69787175..792d2631 100644 --- a/util/jsonpull.c +++ b/util/jsonpull.c @@ -110,20 +110,6 @@ gvm_json_pull_event_init (gvm_json_pull_event_t *event) memset (event, 0, sizeof (gvm_json_pull_event_t)); } -/** - * @brief Resets a JSON pull event data structure for reuse. - * - * @param[in] event The event structure to reset - */ -void -gvm_json_pull_event_reset (gvm_json_pull_event_t *event) -{ - cJSON_free (event->value); - if (event->error_message) - g_free (event->error_message); - memset (event, 0, sizeof (gvm_json_pull_event_t)); -} - /** * @brief Frees all data of JSON pull event data structure. * @@ -744,7 +730,7 @@ gvm_json_pull_parser_next (gvm_json_pull_parser_t *parser, assert (parser); assert (event); - gvm_json_pull_event_reset (event); + gvm_json_pull_event_cleanup (event); if (parser->last_read_char == GVM_JSON_CHAR_UNDEFINED) { // Handle first read of the stream diff --git a/util/jsonpull.h b/util/jsonpull.h index 0b057a49..50d36578 100644 --- a/util/jsonpull.h +++ b/util/jsonpull.h @@ -109,9 +109,6 @@ gvm_json_pull_path_elem_free (gvm_json_path_elem_t *); void gvm_json_pull_event_init (gvm_json_pull_event_t *); -void -gvm_json_pull_event_reset (gvm_json_pull_event_t *); - void gvm_json_pull_event_cleanup (gvm_json_pull_event_t *);