From 0407fa881359ea818177685ad48d0fa15d87988f Mon Sep 17 00:00:00 2001 From: Michael Mullin Date: Sat, 3 Oct 2020 14:19:46 -0400 Subject: [PATCH 1/2] Fix the undefined xfree issue --- src/gpasswd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gpasswd.c b/src/gpasswd.c index 9331d30c..16fc124d 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -123,6 +123,11 @@ static void log_gpasswd_success (const char *suffix); static void log_gpasswd_success_system (/*@null@*/unused void *arg); static void log_gpasswd_success_group (/*@null@*/unused void *arg); +static void xfree(void* p) { + if (p) + free(p); +} + /* * usage - display usage message */ From dfd19fc35b39d78271ff2f34952e4253902d7ded Mon Sep 17 00:00:00 2001 From: Michael Mullin Date: Sat, 3 Oct 2020 14:23:06 -0400 Subject: [PATCH 2/2] Use {} to kep more in line with code style --- src/gpasswd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gpasswd.c b/src/gpasswd.c index 16fc124d..a25bf3e5 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -124,8 +124,9 @@ static void log_gpasswd_success_system (/*@null@*/unused void *arg); static void log_gpasswd_success_group (/*@null@*/unused void *arg); static void xfree(void* p) { - if (p) + if (p) { free(p); + } } /*