summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libotutil/ot-gio-utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libotutil/ot-gio-utils.c b/src/libotutil/ot-gio-utils.c
index f09ee8af..9ee6f7d5 100644
--- a/src/libotutil/ot-gio-utils.c
+++ b/src/libotutil/ot-gio-utils.c
@@ -82,10 +82,13 @@ ot_gfile_ensure_unlinked (GFile *path,
GCancellable *cancellable,
GError **error)
{
- if (unlink (gs_file_get_path_cached (path)) != 0)
+ g_assert (path);
+ const char *pathc = gs_file_get_path_cached (path);
+ g_assert (pathc);
+ if (unlink (pathc) != 0)
{
if (errno != ENOENT)
- return glnx_throw_errno_prefix (error, "unlink(%s)", gs_file_get_path_cached (path));
+ return glnx_throw_errno_prefix (error, "unlink(%s)", pathc);
}
return TRUE;
}