mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-19 09:09:18 +03:00
Avoid null dereference in gtk resource handling
Ensure the error handling in gtk pixmap resource handling does not cause a null pointer dereference. Fixes coverity CID 1307743
This commit is contained in:
parent
1ace8538d1
commit
3dca38cf98
@ -484,10 +484,16 @@ nsgdk_pixbuf_new_from_resname(const char *resname, GdkPixbuf **pixbuf_out)
|
||||
/* pixbuf resources are not currently direct */
|
||||
break;
|
||||
}
|
||||
|
||||
if (new_pixbuf == NULL) {
|
||||
LOG("Unable to create pixbuf from file for %s with path %s \"%s\"",
|
||||
if (error != NULL) {
|
||||
LOG("Unable to create pixbuf from file for %s with path %s \"%s\"",
|
||||
resource->name, resource->path, error->message);
|
||||
g_error_free(error);
|
||||
g_error_free(error);
|
||||
} else {
|
||||
LOG("Unable to create pixbuf from file for %s with path %s",
|
||||
resource->name, resource->path);
|
||||
}
|
||||
return NSERROR_INIT_FAILED;
|
||||
}
|
||||
*pixbuf_out = new_pixbuf;
|
||||
|
Loading…
Reference in New Issue
Block a user