From f6cace609c94e1622039d45905cb2b6dbc317c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 8 May 2025 18:12:11 +0200 Subject: [PATCH] core: fix memory leak in function util_parse_delay --- CHANGELOG.md | 1 + src/core/core-util.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9cc9be72..6360dd742 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - core: consider all keys are safe in cursor context ([#2244](https://github.com/weechat/weechat/issues/2244)) - 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 - irc: display nick changes and quit messages when option irc.look.ignore_tag_messages is enabled ([#2241](https://github.com/weechat/weechat/issues/2241)) - perl: fix build when multiplicity is not available ([#2243](https://github.com/weechat/weechat/issues/2243)) diff --git a/src/core/core-util.c b/src/core/core-util.c index 79cfae973..93d88a768 100644 --- a/src/core/core-util.c +++ b/src/core/core-util.c @@ -573,7 +573,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) @@ -586,6 +585,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 {