summaryrefslogtreecommitdiff
path: root/atari/findfile.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2012-10-19 00:07:37 +0200
committerOle Loots <ole@monochrom.net>2012-10-19 00:07:37 +0200
commit7d18cf2b413753fbe63a602e9572c96196643a18 (patch)
treef0fd65433eef5600775cf4ae4b6228c6f5f01637 /atari/findfile.c
parent004e61e138c78017077db4c4c41ea660d4f614df (diff)
downloadnetsurf-7d18cf2b413753fbe63a602e9572c96196643a18.tar.gz
netsurf-7d18cf2b413753fbe63a602e9572c96196643a18.tar.bz2
Use malloc instead of alloca.
Diffstat (limited to 'atari/findfile.c')
-rwxr-xr-xatari/findfile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/atari/findfile.c b/atari/findfile.c
index 3a06f61e9..93bf4638e 100755
--- a/atari/findfile.c
+++ b/atari/findfile.c
@@ -41,7 +41,7 @@ char * local_file_to_url( const char * filename )
return( NULL );
}
- char * fname_local = alloca( strlen(filename)+1 );
+ char * fname_local = malloc( strlen(filename)+1 );
char * start = (char*)fname_local;
strcpy( start, filename );
@@ -72,6 +72,9 @@ char * local_file_to_url( const char * filename )
url = malloc( strlen(start) + FILE_SCHEME_PREFIX_LEN + 1);
strcpy( url, FILE_SCHEME_PREFIX );
strcat( url, start );
+
+ free(fname_local);
+
return( url );
#undef BACKSLASH
}