summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2013-10-29 20:36:16 -0500
committerAndroid Git Automerger2013-10-29 20:36:16 -0500
commit288ebfda3b7de6d27a9e2ecce315e98f2e408e8b (patch)
tree2c59301466b93d344340d49c415e9544345463e9 /libsparse
parent6996f91809c3b56a7a7e5ba5b170a9905192b62a (diff)
parent9259663cdb8f15226844e3ecfc6e3aa53614ad03 (diff)
downloadplatform-system-core-288ebfda3b7de6d27a9e2ecce315e98f2e408e8b.tar.gz
platform-system-core-288ebfda3b7de6d27a9e2ecce315e98f2e408e8b.tar.xz
platform-system-core-288ebfda3b7de6d27a9e2ecce315e98f2e408e8b.zip
am 9259663c: am f17f5591: am 36d44740: Merge "Fix a bunch of small system/core bugs."
* commit '9259663cdb8f15226844e3ecfc6e3aa53614ad03': Fix a bunch of small system/core bugs.
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;