Fix memory-corruption. Thanks to JonY for tracking it down. git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@6389 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-tools/gendef/src/gendef_def.c b/mingw-w64-tools/gendef/src/gendef_def.c index 294ca69..3073558 100644 --- a/mingw-w64-tools/gendef/src/gendef_def.c +++ b/mingw-w64-tools/gendef/src/gendef_def.c
@@ -74,11 +74,12 @@ r1 = r2; } symbolname = r1; - r2 = strdup (dllname); + r2 = (char *) malloc (strlen (dllname) + 5); + strcpy (r2, dllname); strcpy (strchr (r2, '.'), ".dll"); dllname = r2; } - def = (char *) malloc (strlen (dllname) + 4); + def = (char *) malloc (strlen (dllname) + 5); strcpy (def, dllname); strlwr (def); if (strchr (def, '.') == NULL)