diff options
author | Elliott Hughes | 2013-10-29 20:36:16 -0500 |
---|---|---|
committer | Android Git Automerger | 2013-10-29 20:36:16 -0500 |
commit | 288ebfda3b7de6d27a9e2ecce315e98f2e408e8b (patch) | |
tree | 2c59301466b93d344340d49c415e9544345463e9 | |
parent | 6996f91809c3b56a7a7e5ba5b170a9905192b62a (diff) | |
parent | 9259663cdb8f15226844e3ecfc6e3aa53614ad03 (diff) | |
download | platform-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.
-rw-r--r-- | adb/file_sync_client.c | 2 | ||||
-rw-r--r-- | adb/file_sync_service.c | 1 | ||||
-rw-r--r-- | cpio/mkbootfs.c | 2 | ||||
-rw-r--r-- | fastboot/Android.mk | 1 | ||||
-rw-r--r-- | fastboot/fastboot.c | 8 | ||||
-rw-r--r-- | gpttool/gpttool.c | 2 | ||||
-rw-r--r-- | libcutils/dir_hash.c | 1 | ||||
-rw-r--r-- | libsparse/backed_block.c | 2 | ||||
-rw-r--r-- | libsparse/output_file.c | 2 |
9 files changed, 17 insertions, 4 deletions
diff --git a/adb/file_sync_client.c b/adb/file_sync_client.c index 354d0fb33..9fec081d0 100644 --- a/adb/file_sync_client.c +++ b/adb/file_sync_client.c | |||
@@ -642,8 +642,8 @@ static int local_build_list(copyinfo **filelist, | |||
642 | ci = mkcopyinfo(lpath, rpath, name, 0); | 642 | ci = mkcopyinfo(lpath, rpath, name, 0); |
643 | if(lstat(ci->src, &st)) { | 643 | if(lstat(ci->src, &st)) { |
644 | fprintf(stderr,"cannot stat '%s': %s\n", ci->src, strerror(errno)); | 644 | fprintf(stderr,"cannot stat '%s': %s\n", ci->src, strerror(errno)); |
645 | free(ci); | ||
645 | closedir(d); | 646 | closedir(d); |
646 | |||
647 | return -1; | 647 | return -1; |
648 | } | 648 | } |
649 | if(!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) { | 649 | if(!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) { |
diff --git a/adb/file_sync_service.c b/adb/file_sync_service.c index d3e841b2d..f24f14cb4 100644 --- a/adb/file_sync_service.c +++ b/adb/file_sync_service.c | |||
@@ -110,6 +110,7 @@ static int do_list(int s, const char *path) | |||
110 | 110 | ||
111 | if(writex(s, &msg.dent, sizeof(msg.dent)) || | 111 | if(writex(s, &msg.dent, sizeof(msg.dent)) || |
112 | writex(s, de->d_name, len)) { | 112 | writex(s, de->d_name, len)) { |
113 | closedir(d); | ||
113 | return -1; | 114 | return -1; |
114 | } | 115 | } |
115 | } | 116 | } |
diff --git a/cpio/mkbootfs.c b/cpio/mkbootfs.c index 3569e27f4..7d3740c0f 100644 --- a/cpio/mkbootfs.c +++ b/cpio/mkbootfs.c | |||
@@ -220,6 +220,8 @@ static void _archive_dir(char *in, char *out, int ilen, int olen) | |||
220 | free(names[i]); | 220 | free(names[i]); |
221 | } | 221 | } |
222 | free(names); | 222 | free(names); |
223 | |||
224 | closedir(d); | ||
223 | } | 225 | } |
224 | 226 | ||
225 | static void _archive(char *in, char *out, int ilen, int olen) | 227 | static void _archive(char *in, char *out, int ilen, int olen) |
diff --git a/fastboot/Android.mk b/fastboot/Android.mk index f33998876..b9b3c92cc 100644 --- a/fastboot/Android.mk +++ b/fastboot/Android.mk | |||
@@ -21,6 +21,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \ | |||
21 | LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c | 21 | LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c |
22 | LOCAL_MODULE := fastboot | 22 | LOCAL_MODULE := fastboot |
23 | LOCAL_MODULE_TAGS := debug | 23 | LOCAL_MODULE_TAGS := debug |
24 | LOCAL_CFLAGS += -std=gnu99 | ||
24 | 25 | ||
25 | ifeq ($(HOST_OS),linux) | 26 | ifeq ($(HOST_OS),linux) |
26 | LOCAL_SRC_FILES += usb_linux.c util_linux.c | 27 | LOCAL_SRC_FILES += usb_linux.c util_linux.c |
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c index 1af6b3942..73a6e5616 100644 --- a/fastboot/fastboot.c +++ b/fastboot/fastboot.c | |||
@@ -491,7 +491,13 @@ static int setup_requirement_line(char *name) | |||
491 | 491 | ||
492 | for(n = 0; n < count; n++) { | 492 | for(n = 0; n < count; n++) { |
493 | out[n] = strdup(strip(val[n])); | 493 | out[n] = strdup(strip(val[n])); |
494 | if (out[n] == 0) return -1; | 494 | if (out[n] == 0) { |
495 | for(size_t i = 0; i < n; ++i) { | ||
496 | free((char*) out[i]); | ||
497 | } | ||
498 | free(out); | ||
499 | return -1; | ||
500 | } | ||
495 | } | 501 | } |
496 | 502 | ||
497 | fb_queue_require(prod, name, invert, n, out); | 503 | fb_queue_require(prod, name, invert, n, out); |
diff --git a/gpttool/gpttool.c b/gpttool/gpttool.c index 05d51779c..d3f08fe14 100644 --- a/gpttool/gpttool.c +++ b/gpttool/gpttool.c | |||
@@ -161,7 +161,7 @@ void show(struct ptable *ptbl) | |||
161 | { | 161 | { |
162 | struct efi_entry *entry = ptbl->entry; | 162 | struct efi_entry *entry = ptbl->entry; |
163 | unsigned n, m; | 163 | unsigned n, m; |
164 | char name[EFI_NAMELEN]; | 164 | char name[EFI_NAMELEN + 1]; |
165 | 165 | ||
166 | fprintf(stderr,"ptn start block end block name\n"); | 166 | fprintf(stderr,"ptn start block end block name\n"); |
167 | fprintf(stderr,"---- ------------- ------------- --------------------\n"); | 167 | fprintf(stderr,"---- ------------- ------------- --------------------\n"); |
diff --git a/libcutils/dir_hash.c b/libcutils/dir_hash.c index be14af65c..098b5db5a 100644 --- a/libcutils/dir_hash.c +++ b/libcutils/dir_hash.c | |||
@@ -159,6 +159,7 @@ static int recurse(HashAlgorithm algorithm, const char *directory_path, | |||
159 | 159 | ||
160 | free(name); | 160 | free(name); |
161 | free(node); | 161 | free(node); |
162 | closedir(d); | ||
162 | return -1; | 163 | return -1; |
163 | } | 164 | } |
164 | 165 | ||
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; |