lib/mtree: drop redundant name checks

This drops several NULL checks against filename input argument.
Those checks are both redundant (as filename validation already
checks for that) and dangerous (as they return early without
setting an error value).
This commit is contained in:
Luca BRUNO 2022-09-07 12:33:37 +00:00
parent 73eda79662
commit 642efe924f
No known key found for this signature in database
GPG Key ID: A9834A2252078E4E
1 changed files with 0 additions and 6 deletions

View File

@ -303,8 +303,6 @@ ostree_mutable_tree_replace_file (OstreeMutableTree *self,
const char *checksum, const char *checksum,
GError **error) GError **error)
{ {
g_return_val_if_fail (name != NULL, FALSE);
if (!ot_util_filename_validate (name, error)) if (!ot_util_filename_validate (name, error))
return FALSE; return FALSE;
@ -338,8 +336,6 @@ ostree_mutable_tree_remove (OstreeMutableTree *self,
gboolean allow_noent, gboolean allow_noent,
GError **error) GError **error)
{ {
g_return_val_if_fail (name != NULL, FALSE);
if (!ot_util_filename_validate (name, error)) if (!ot_util_filename_validate (name, error))
return FALSE; return FALSE;
@ -374,8 +370,6 @@ ostree_mutable_tree_ensure_dir (OstreeMutableTree *self,
OstreeMutableTree **out_subdir, OstreeMutableTree **out_subdir,
GError **error) GError **error)
{ {
g_return_val_if_fail (name != NULL, FALSE);
if (!ot_util_filename_validate (name, error)) if (!ot_util_filename_validate (name, error))
return FALSE; return FALSE;