llvm.org GIT mirror llvm / a962b40
Fix a use after free. Patch by Frits van Bommel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119842 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 9 years ago
1 changed file(s) with 9 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
764764 }
765765 }
766766
767 // Now that we know if -debug is specified, we can use it.
768 // Note that if ReadResponseFiles == true, this must be done before the
769 // memory allocated for the expanded command line is free()d below.
770 DEBUG(dbgs() << "Args: ";
771 for (int i = 0; i < argc; ++i)
772 dbgs() << argv[i] << ' ';
773 dbgs() << '\n';
774 );
775
767776 // Free all of the memory allocated to the map. Command line options may only
768777 // be processed once!
769778 Opts.clear();
777786 i != e; ++i)
778787 free(*i);
779788 }
780
781 DEBUG(dbgs() << "Args: ";
782 for (int i = 0; i < argc; ++i)
783 dbgs() << argv[i] << ' ';
784 dbgs() << '\n';
785 );
786789
787790 // If we had an error processing our arguments, don't let the program execute
788791 if (ErrorParsing) exit(1);