summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'libsparse')
-rw-r--r--libsparse/backed_block.c2
-rw-r--r--libsparse/output_file.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/libsparse/backed_block.c b/libsparse/backed_block.c
index dfb217b30..3e72b57c7 100644
--- a/libsparse/backed_block.c
+++ b/libsparse/backed_block.c
@@ -370,7 +370,7 @@ int backed_block_split(struct backed_block_list *bbl, struct backed_block *bb,
370 } 370 }
371 371
372 new_bb = malloc(sizeof(struct backed_block)); 372 new_bb = malloc(sizeof(struct backed_block));
373 if (bb == NULL) { 373 if (new_bb == NULL) {
374 return -ENOMEM; 374 return -ENOMEM;
375 } 375 }
376 376
diff --git a/libsparse/output_file.c b/libsparse/output_file.c
index 24280227e..a28b0a5ad 100644
--- a/libsparse/output_file.c
+++ b/libsparse/output_file.c
@@ -722,10 +722,12 @@ int write_fd_chunk(struct output_file *out, unsigned int len,
722 } 722 }
723 pos = lseek64(fd, offset, SEEK_SET); 723 pos = lseek64(fd, offset, SEEK_SET);
724 if (pos < 0) { 724 if (pos < 0) {
725 free(data);
725 return -errno; 726 return -errno;
726 } 727 }
727 ret = read_all(fd, data, len); 728 ret = read_all(fd, data, len);
728 if (ret < 0) { 729 if (ret < 0) {
730 free(data);
729 return ret; 731 return ret;
730 } 732 }
731 ptr = data; 733 ptr = data;