diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb0543e1..a4430c169 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - core: fix integer overflow with decimal numbers in calculation of expression - core: fix integer overflow in base32 encoding/decoding +- core: fix memory leak in function util_parse_delay ## Version 4.6.2 (2025-04-18) diff --git a/src/core/core-util.c b/src/core/core-util.c index 6a38dd9dc..0d3185b26 100644 --- a/src/core/core-util.c +++ b/src/core/core-util.c @@ -571,7 +571,6 @@ util_parse_delay (const char *string_delay, unsigned long long default_factor, if ((pos > string_delay) && pos[0]) { - str_number = string_strndup (string_delay, pos - string_delay); if (strcmp (pos, "us") == 0) factor = 1ULL; else if (strcmp (pos, "ms") == 0) @@ -584,6 +583,7 @@ util_parse_delay (const char *string_delay, unsigned long long default_factor, factor = 1000ULL * 1000ULL * 60ULL * 60ULL; else return 0; + str_number = string_strndup (string_delay, pos - string_delay); } else {