mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 13:06:49 +03:00
Use malloc instead of alloca.
This commit is contained in:
parent
004e61e138
commit
7d18cf2b41
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user