From: Michael Schroeder Date: Fri, 12 Apr 2019 09:20:34 +0000 (+0200) Subject: Fix mem leak in solv_jsonparser X-Git-Tag: 0.7.5~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1b6f022b06620ca810170c63db97da31b6880f4;p=thirdparty%2Flibsolv.git Fix mem leak in solv_jsonparser jsonparser_free did not free the string buffer --- 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);