Skip to content

Commit

Permalink
lib: Add an unref in an error path
Browse files Browse the repository at this point in the history
This was spotted by gcc `-fanalyzer`.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jul 14, 2023
1 parent 1704f82 commit e1f8e7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libcomposefs/lcfs-writer-erofs.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,10 @@ static int add_overlay_whiteouts(struct lcfs_node_s *root)
if (selinux != NULL) {
res = lcfs_node_set_xattr(child, "security.selinux",
selinux, selinux_len);
if (res < 0)
if (res < 0) {
lcfs_node_unref(child);
return res;
}
}

res = lcfs_node_add_child(root, child, name);
Expand Down

0 comments on commit e1f8e7f

Please sign in to comment.