Commit 3c1b4016 authored by Tomáš Bžatek's avatar Tomáš Bžatek
Browse files

Fix some potential NULL dereferences

parent 3350ccfa
......@@ -1497,7 +1497,7 @@ ensure_ignore_prefix (GVfsBackendGphoto2 *gphoto2_backend, GVfsJob *job)
}
/* Some cameras, such as the Canon 5D, won't report the basedir */
if (head->fields & GP_STORAGEINFO_BASE)
if (head && head->fields & GP_STORAGEINFO_BASE)
prefix = g_strdup_printf ("%s/", head->basedir);
out:
......
......@@ -154,7 +154,7 @@ get_g_file_info_from_local (const char *filename, GFile *file,
error = NULL;
info = g_file_query_info (file, attributes, flags, G_VFS_JOB (job)->cancellable, &error);
if ((error) || (! info) ) {
if (info == NULL) {
g_print (" (EE) get_g_file_info_from_local (filename = '%s'): g_file_query_info failed: %s \n", filename, error->message);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
return NULL;
......@@ -392,7 +392,7 @@ do_query_fs_info (GVfsBackend *backend,
if (file) {
error = NULL;
info2 = g_file_query_filesystem_info (file, "fs:*", G_VFS_JOB (job)->cancellable, &error);
if ((error) || (! info2) ) {
if (info2 == NULL) {
g_print (" (EE) try_query_fs_info (filename = '%s'): g_file_query_filesystem_info failed: %s \n", filename, error->message);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
g_error_free (error);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment