commit | bfe40222e2bd5955b13c83149a369335721a58d2 | [log] [tgz] |
---|---|---|
author | Nicolas Iooss <nicolas.iooss@m4x.org> | Tue Apr 11 23:46:02 2017 +0200 |
committer | Stephen Smalley <sds@tycho.nsa.gov> | Wed Apr 12 14:47:45 2017 -0400 |
tree | e2449f2bc0ec90f80845c733425363fe89ffaddb | |
parent | bb3f428c081fb7dd61453ce8cc749d1bf9162c94 [diff] |
policycoreutils: newrole: do not free pw strings twice In main(), if "extract_pw_data(&pw)" returns a failed value, it has already freed pw.pw_name, pw.pw_dir and pw.pw_shell. These fields are freed a second time in main's err_free label, which is incorrect. Work around this by setting them to NULL after they are freed. This issue has been found using clang's static analyzer. While at it, make extract_pw_data() static. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>