Minor cleanup -- clear name structure before parsing

llvm-svn: 276089
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index 52715dd..76d81d0 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -266,6 +266,11 @@
   char *Hostname = &lprofCurFilename.Hostname[0];
   int MergingEnabled = 0;
 
+  /* Clean up cached prefix.  */
+  if (lprofCurFilename.ProfilePathPrefix)
+    free((void *)lprofCurFilename.ProfilePathPrefix);
+  memset(&lprofCurFilename, 0, sizeof(lprofCurFilename));
+
   lprofCurFilename.FilenamePat = FilenamePat;
   /* Check the filename for "%p", which indicates a pid-substitution. */
   for (I = 0; FilenamePat[I]; ++I)
@@ -345,12 +350,6 @@
               getPNSStr(PNS));
   }
 
-  /* Clean up cached prefix.  */
-  if (lprofCurFilename.ProfilePathPrefix) {
-    free((void*)lprofCurFilename.ProfilePathPrefix);
-    lprofCurFilename.ProfilePathPrefix = NULL;
-  }
-
   if (!lprofCurFilename.MergePoolSize)
     truncateCurrentFile();
 }