Skip to content

Commit

Permalink
writer: Fix missing error return value checks
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
  • Loading branch information
eriksjolund committed Aug 28, 2023
1 parent 1aed878 commit 316cd30
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 316cd30

Please sign in to comment.