diff options
author | vkalintiris <vasilis@netdata.cloud> | 2022-04-04 15:01:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-04 15:01:48 +0300 |
commit | c086b6611207dd6599d4375eee51e46f2e5894a5 (patch) | |
tree | 798f70f9273914a4d60a27cbcfa1a87e54347640 /daemon/unit_test.c | |
parent | 22e5bb32ea6705c68e3760f43654dba2c4b06118 (diff) |
Fix coverity issues (#12598)
* Clamp LagN to non-zero values.
* Free static threads even on test failure.
* Initialize rusage.
* s/free/freez/
Diffstat (limited to 'daemon/unit_test.c')
-rw-r--r-- | daemon/unit_test.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/daemon/unit_test.c b/daemon/unit_test.c index ff2c1c5167..0502048754 100644 --- a/daemon/unit_test.c +++ b/daemon/unit_test.c @@ -420,6 +420,7 @@ int unit_test_static_threads() { if (n < 2) { fprintf(stderr, "only %d static threads registered", n); + freez(static_threads); return 1; } @@ -432,11 +433,12 @@ int unit_test_static_threads() { continue; fprintf(stderr, "Found duplicate threads with name: %s\n", static_threads[i].name); + freez(static_threads); return 1; } } - free(static_threads); + freez(static_threads); return 0; } |