Browse code

core: parser - free unlinked local param structure in parse_to_param()

Daniel-Constantin Mierla authored on 08/09/2021 12:57:52
Showing 1 changed files
... ...
@@ -281,6 +281,10 @@ static char *parse_to_param(char *const buffer, const char *const end,
281 281
 					semicolon_add_param:
282 282
 						add_param(param, to_b, newparam);
283 283
 					case E_PARA_VALUE:
284
+						if(newparam) {
285
+							pkg_free(newparam);
286
+							newparam = NULL;
287
+						}
284 288
 						param = (struct to_param *)pkg_malloc(
285 289
 								sizeof(struct to_param));
286 290
 						if(!param) {