Plug memory leak with multiple matching CHROOT= entries.

Found by oss-fuzz.
This commit is contained in:
Todd C. Miller
2023-02-27 08:57:17 -07:00
parent f4d2412628
commit a4f31cff2b

View File

@@ -895,6 +895,7 @@ done:
/* Restore user_cmnd and user_stat. */
if (saved_user_cmnd != NULL) {
if (info != NULL) {
free(info->cmnd_path);
info->cmnd_path = user_cmnd;
if (user_stat != NULL)
info->cmnd_stat = *user_stat;