/[path-sandbox]/trunk/src/sandbox.c
Gentoo

Diff of /trunk/src/sandbox.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 303 Revision 304
544 return 0; 544 return 0;
545 } 545 }
546 546
547 /* execve() creates a copy of this, so no need to use more memory than 547 /* execve() creates a copy of this, so no need to use more memory than
548 * absolutely needed. */ 548 * absolutely needed. */
549 str_list_free(argv_bash);
549 str_list_free(env); 550 str_list_free(env);
550 551
551 ret = waitpid(child_pid, &status, 0); 552 ret = waitpid(child_pid, &status, 0);
552 if ((-1 == ret) || (status > 0)) { 553 if ((-1 == ret) || (status > 0)) {
553 if (debug) 554 if (debug)
672 673
673 /* Start Bash */ 674 /* Start Bash */
674 if (!spawn_shell(argv_bash, sandbox_environ, print_debug)) 675 if (!spawn_shell(argv_bash, sandbox_environ, print_debug))
675 success = 0; 676 success = 0;
676 677
677 /* Free bash argv stuff */ 678 /* As spawn_shell() free both argv_bash and sandbox_environ, make sure
678 str_list_free(argv_bash); 679 * we do not run into issues in future if we need a OOM error below
680 * this ... */
681 argv_bash = NULL;
682 sandbox_environ = NULL;
679 683
680 if (print_debug) 684 if (print_debug)
681 printf("Cleaning up sandbox process\n"); 685 printf("Cleaning up sandbox process\n");
682 686
683 if (print_debug) { 687 if (print_debug) {

Legend:
Removed from v.303  
changed lines
  Added in v.304

  ViewVC Help
Powered by ViewVC 1.1.20