diff --git a/plugins/sudoers/match_command.c b/plugins/sudoers/match_command.c index 768f2fd26..288541f8e 100644 --- a/plugins/sudoers/match_command.c +++ b/plugins/sudoers/match_command.c @@ -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;