diff options
author | Elliott Hughes <enh@google.com> | 2013-10-29 18:36:16 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-29 18:36:16 -0700 |
commit | 288ebfda3b7de6d27a9e2ecce315e98f2e408e8b (patch) | |
tree | 2c59301466b93d344340d49c415e9544345463e9 /libsparse | |
parent | 6996f91809c3b56a7a7e5ba5b170a9905192b62a (diff) | |
parent | 9259663cdb8f15226844e3ecfc6e3aa53614ad03 (diff) | |
download | system_core-288ebfda3b7de6d27a9e2ecce315e98f2e408e8b.zip system_core-288ebfda3b7de6d27a9e2ecce315e98f2e408e8b.tar.gz system_core-288ebfda3b7de6d27a9e2ecce315e98f2e408e8b.tar.bz2 |
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.c | 2 | ||||
-rw-r--r-- | libsparse/output_file.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/libsparse/backed_block.c b/libsparse/backed_block.c index dfb217b..3e72b57 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, } new_bb = malloc(sizeof(struct backed_block)); - if (bb == NULL) { + if (new_bb == NULL) { return -ENOMEM; } diff --git a/libsparse/output_file.c b/libsparse/output_file.c index 2428022..a28b0a5 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, } pos = lseek64(fd, offset, SEEK_SET); if (pos < 0) { + free(data); return -errno; } ret = read_all(fd, data, len); if (ret < 0) { + free(data); return ret; } ptr = data; |