]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix mem leak in solv_jsonparser
authorMichael Schroeder <mls@suse.de>
Fri, 12 Apr 2019 09:20:34 +0000 (11:20 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 12 Apr 2019 09:20:34 +0000 (11:20 +0200)
jsonparser_free did not free the string buffer

ext/solv_jsonparser.c
ext/solv_jsonparser.h

index 8cfcb38afcb731b4645a12f2b3678445b7bcf6f1..ea319233d4b3fb5df885461975201ca11d071d79 100644 (file)
@@ -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
index 50d8b5334dc07ed1f16ed9b7394139e331d2930a..f728fb68a73373eb1f391b91066f05c052ecfc3a 100644 (file)
@@ -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);