BUG/MINOR: tools: Add OOM check for malloc() in indent_msg()

This patch adds a missing out-of-memory (OOM) check after
the call to `malloc()` in `indent_msg()`. If memory
allocation fails, the function returns NULL to prevent
undefined behavior.

Co-authored-by: Christian Norbert Menges <christian.norbert.menges@sap.com>
This commit is contained in:
Alexander Stephan 2025-09-01 10:01:50 +00:00 committed by Willy Tarreau
parent aa20905ac9
commit 26776c7b8f

View File

@ -4689,6 +4689,8 @@ char *indent_msg(char **out, int level)
needed = 1 + level * (lf + 1) + len + 1;
p = ret = malloc(needed);
if (unlikely(!ret))
return NULL;
in = *out;
/* skip initial LFs */