mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
Avoid potential use of NULL pointer.
svn path=/trunk/netsurf/; revision=10588
This commit is contained in:
parent
6ab058fb46
commit
a327c4e624
@ -751,6 +751,10 @@ char *path_to_url(const char *path)
|
||||
int urllen = strlen(path) + FILE_SCHEME_PREFIX_LEN + 1;
|
||||
char *url = malloc(urllen);
|
||||
|
||||
if (url == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (*path == '/') {
|
||||
path++; /* file: paths are already absolute */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user