Skip to content

Commit 7ba8fdc

Browse files
committed
Change position of 'free' for 'env_values' variable.
1 parent 4430190 commit 7ba8fdc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SCE/sce_engine.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,6 @@ xccdf_test_result_type_t sce_engine_eval_rule(struct xccdf_policy *policy, const
512512

513513
if (fork_result == 0)
514514
{
515-
free_env_values(env_values, index_of_first_env_value_not_compiled_in, env_value_count);
516-
517515
// we won't read from the pipes, so close the reading fd
518516
close(stdout_pipefd[0]);
519517
close(stderr_pipefd[0]);
@@ -540,6 +538,8 @@ xccdf_test_result_type_t sce_engine_eval_rule(struct xccdf_policy *policy, const
540538
// we are the child process
541539
execve(tmp_href, argvp, env_values);
542540

541+
free_env_values(env_values, index_of_first_env_value_not_compiled_in, env_value_count);
542+
543543
// no need to check the return value of execve, if it returned at all we are in trouble
544544
printf("Unexpected error when executing script '%s'. Error message follows.\n", href);
545545
perror("execve");

0 commit comments

Comments
 (0)