Fix crash when not setting GCOV_PREFIX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2011-05-04 03:58:45 +00:00
parent fffb61d042
commit d006ddc195

View File

@ -54,7 +54,7 @@ static char *mangle_filename(const char *orig_filename) {
prefix = getenv("GCOV_PREFIX");
if (!prefix)
return strdup(filename);
return strdup(orig_filename);
filename = malloc(strlen(prefix) + 1 + strlen(orig_filename) + 1);
strcpy(filename, prefix);