Browse code

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

(cherry picked from commit f624e1701088a94465a06f36a2ef27804b16ec0e)
(cherry picked from commit 04c7d84874bf60dabede57adb1fc64ebe2260420)
(cherry picked from commit 4f438e01d4e6c6042026e9c5f673e1e2f02bf496)

Daniel-Constantin Mierla authored on 08/09/2021 12:57:52 • Henning Westerholt committed on 22/10/2021 12:12:27
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) {