From a327c4e624a27e65f88d718df7cd615e6a372d48 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 29 Jun 2010 06:05:54 +0000 Subject: [PATCH] Avoid potential use of NULL pointer. svn path=/trunk/netsurf/; revision=10588 --- gtk/gtk_gui.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c index b7cae501e..79391ab4f 100644 --- a/gtk/gtk_gui.c +++ b/gtk/gtk_gui.c @@ -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 */ }