Make mkpath allocate the string buffer for map_filename. Fixes 2119.
This commit is contained in:
parent
7dc170e6d8
commit
318edea47e
|
@ -393,14 +393,16 @@ STRPTR ami_locale_langs(void)
|
|||
bool ami_gui_map_filename(char **remapped, const char *path, const char *file, const char *map)
|
||||
{
|
||||
BPTR fh = 0;
|
||||
char mapfile[1024];
|
||||
size_t mapfile_size = 1024;
|
||||
char *mapfile = NULL;
|
||||
size_t mapfile_size = 0;
|
||||
char buffer[1024];
|
||||
char *realfname;
|
||||
bool found = false;
|
||||
|
||||
amiga_mkpath(&mapfile, &mapfile_size, 2, path, map);
|
||||
|
||||
if(mapfile == NULL) return false;
|
||||
|
||||
if(fh = FOpen(mapfile, MODE_OLDFILE, 0))
|
||||
{
|
||||
while(FGets(fh, buffer, 1024) != 0)
|
||||
|
@ -427,6 +429,8 @@ bool ami_gui_map_filename(char **remapped, const char *path, const char *file, c
|
|||
if(found == false) *remapped = strdup(file);
|
||||
else LOG(("Remapped %s to %s in path %s using %s", file, *remapped, path, map));
|
||||
|
||||
free(mapfile);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue