From: Alejandro Colomar Date: Wed, 1 Feb 2023 23:59:55 +0000 (+0100) Subject: Fix memory leaks by replacing realloc(3) with reallocf(3) X-Git-Tag: 4.14.0-rc1~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ec157d579931cfec1cc8439288ed17adf19da5d;p=thirdparty%2Fshadow.git Fix memory leaks by replacing realloc(3) with reallocf(3) Signed-off-by: Alejandro Colomar --- diff --git a/src/newusers.c b/src/newusers.c index 22db1e9aa..5fd83d6ed 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -1200,9 +1200,9 @@ int main (int argc, char **argv) #ifdef USE_PAM /* keep the list of user/password for later update by PAM */ nusers++; - lines = realloc (lines, sizeof (lines[0]) * nusers); - usernames = realloc (usernames, sizeof (usernames[0]) * nusers); - passwords = realloc (passwords, sizeof (passwords[0]) * nusers); + lines = reallocf (lines, sizeof (lines[0]) * nusers); + usernames = reallocf (usernames, sizeof (usernames[0]) * nusers); + passwords = reallocf (passwords, sizeof (passwords[0]) * nusers); lines[nusers-1] = line; usernames[nusers-1] = strdup (fields[0]); passwords[nusers-1] = strdup (fields[1]);