From 7d18cf2b413753fbe63a602e9572c96196643a18 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Fri, 19 Oct 2012 00:07:37 +0200 Subject: [PATCH] Use malloc instead of alloca. --- atari/findfile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }