From 8b8f609c6666fd28718cd7421a8e451d1d8ccf24 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Wed, 5 Nov 2025 21:35:37 +0100 Subject: [PATCH] try with valgrind --- .woodpecker/build.yaml | 5 +++-- dicepwgen.c | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index c5bc65e..b81ce00 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -12,9 +12,10 @@ steps: image: alpine:latest commands: - apk update - - apk add --no-cache bash build-base words-en gdb + - apk add --no-cache bash build-base words-en gdb valgrind - make - - gdb -batch -ex "run" -ex "bt" --args dicepwgen + - valgrind --leak-check=full --show-reachable=yes ./dicepwgen + #- gdb -batch -ex "run" -ex "bt" --args dicepwgen #- ./dicepwgen -y | grep -E '[a-z]*%' diff --git a/dicepwgen.c b/dicepwgen.c index 9a157d0..e8b289f 100644 --- a/dicepwgen.c +++ b/dicepwgen.c @@ -178,8 +178,4 @@ void getwords(char *dictfile, int count) { for (i = 0; i < 66666; i++) if (words[i] != NULL) free(words[i]); - - if (words != NULL) { - free(words); - } }