mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-05 13:18:17 +03:00
utils: Fix unreachable NULL
deref by adding assertion
Again this one is just in theory, but let's add an assertion.
This commit is contained in:
parent
f355482e1f
commit
54bf42c3e5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user