Commit 97279364 by Richard Kenner

(do_include): Re-fix minor memory leak by using alloca instead of

xmalloc and free.

From-SVN: r9544
parent 040c67b3
...@@ -4573,13 +4573,12 @@ get_filename: ...@@ -4573,13 +4573,12 @@ get_filename:
if (searchptr->fname[0] == 0) if (searchptr->fname[0] == 0)
continue; continue;
p = xmalloc (strlen (searchptr->fname) p = alloca (strlen (searchptr->fname)
+ strlen (fname) + 2); + strlen (fname) + 2);
strcpy (p, searchptr->fname); strcpy (p, searchptr->fname);
strcat (p, "/"); strcat (p, "/");
strcat (p, fname); strcat (p, fname);
deps_output (p, ' '); deps_output (p, ' ');
free (p);
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment