Debian Patches

Status for watchdog/5.16-2

Patch Description Author Forwarded Bugs Origin Last update
fix-memory-leak.patch Fix memory leak in realloc()
Coverity report shows a memory leak in watchdog-5.16/src/run-as-child.c:102
with `realloc()` call. Issue is that realloc may return `NULL` when there
is an error causing `opt` to be a null pointer and losing the pointer to
the memory that was allocated by `strdup()` or reallocated by `realloc()`.

Steps to Reproduce:

1. watchdog needs to be run with the verbose flag

2. watchdog needs to receive test/repair arguments of sufficient length to
cause a ENOMEM or another error that may be triggered by realloc

Patch courtesy of Josef Ridky, RedHat

diff --git a/src/run-as-child.c b/src/run-as-child.c
index fc1f36f..8ead6e6 100644
Paul Crawford <paulcrawford@users.sourceforge.net> no debian 2021-10-14

All known versions for source package 'watchdog'

Links