From f1b6f022b06620ca810170c63db97da31b6880f4 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Fri, 12 Apr 2019 11:20:34 +0200 Subject: [PATCH] Fix mem leak in solv_jsonparser jsonparser_free did not free the string buffer --- ext/solv_jsonparser.c | 4 ++-- ext/solv_jsonparser.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/solv_jsonparser.c b/ext/solv_jsonparser.c index 8cfcb38a..ea319233 100644 --- a/ext/solv_jsonparser.c +++ b/ext/solv_jsonparser.c @@ -26,11 +26,11 @@ jsonparser_init(struct solv_jsonparser *jp, FILE *fp) queue_init(&jp->stateq); } -struct solv_jsonparser * +void jsonparser_free(struct solv_jsonparser *jp) { + solv_free(jp->space); queue_free(&jp->stateq); - return 0; } static void diff --git a/ext/solv_jsonparser.h b/ext/solv_jsonparser.h index 50d8b533..f728fb68 100644 --- a/ext/solv_jsonparser.h +++ b/ext/solv_jsonparser.h @@ -42,7 +42,7 @@ struct solv_jsonparser { #define JP_ARRAY_END 9 void jsonparser_init(struct solv_jsonparser *jp, FILE *fp); -struct solv_jsonparser *jsonparser_free(struct solv_jsonparser *jp); +void jsonparser_free(struct solv_jsonparser *jp); int jsonparser_parse(struct solv_jsonparser *jp); int jsonparser_skip(struct solv_jsonparser *jp, int type); -- 2.47.3