Use malloc instead of alloca.

This commit is contained in:
Ole Loots 2012-10-19 00:07:37 +02:00
parent 004e61e138
commit 7d18cf2b41

View File

@ -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
}