Skip to content

Commit

Permalink
Merge pull request #180 from eriksjolund/fix-missing-error-return-val…
Browse files Browse the repository at this point in the history
…ue-checks

writer: Fix missing error return value checks
  • Loading branch information
alexlarsson committed Aug 29, 2023
2 parents 1aed878 + 316cd30 commit ab04082
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libcomposefs/lcfs-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,8 @@ static void lcfs_node_destroy(struct lcfs_node_s *node)
struct lcfs_node_s *lcfs_node_clone(struct lcfs_node_s *node)
{
struct lcfs_node_s *new = lcfs_node_new();
if (new == NULL)
return NULL;

/* Note: This copies only data, not structure like name or children */

Expand Down Expand Up @@ -918,6 +920,8 @@ static struct lcfs_node_s *_lcfs_node_clone_deep(struct lcfs_node_s *node,
struct lcfs_clone_data *data)
{
struct lcfs_node_s *new = lcfs_node_clone(node);
if (new == NULL)
return NULL;

if (data->n_mappings >= data->allocated_mappings) {
struct lcfs_node_mapping_s *new_mapping;
Expand Down

0 comments on commit ab04082

Please sign in to comment.