]> git.ipfire.org Git - thirdparty/shadow.git/commit
src/useradd.c: set_defaults(): Do not free(3) the result of asprintf(3) if it failed
authorAlejandro Colomar <alx@kernel.org>
Fri, 17 May 2024 11:10:46 +0000 (13:10 +0200)
committerAlejandro Colomar <alx@kernel.org>
Fri, 17 May 2024 23:15:10 +0000 (01:15 +0200)
commit701fe4cf1aeac9e66fa949369c91d135dbf375d2
tree4b4ff1be2f8dc2c5df64c6165d885b8dda0cc482
parent37ae8827a0869ee4a723954c3c9e7c48165d9b50
src/useradd.c: set_defaults(): Do not free(3) the result of asprintf(3) if it failed

See asprintf(3):

RETURN VALUE
     When successful,  these  functions  return  the  number  of  bytes
     printed, just like sprintf(3).  If memory allocation wasn’t possi‐
     ble,  or  some other error occurs, these functions will return -1,
     and the contents of strp are undefined.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/useradd.c