summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-10-29 14:12:46 -0700
committerElliott Hughes <enh@google.com>2013-10-29 14:12:46 -0700
commit14e28d39f7f094225c1ddae8fa43bd792c621a8f (patch)
treef4d986698864a59ea87af253247753768916be37 /adb
parent98f87d92d89079f274374409efcf57ca52b13c1f (diff)
downloadsystem_core-14e28d39f7f094225c1ddae8fa43bd792c621a8f.zip
system_core-14e28d39f7f094225c1ddae8fa43bd792c621a8f.tar.gz
system_core-14e28d39f7f094225c1ddae8fa43bd792c621a8f.tar.bz2
Fix a bunch of small system/core bugs.
Missing frees in: adb/file_sync_client.c fastboot/fastboot.c libsparse/output_file.c Missing closedirs in: adb/file_sync_service.c cpio/mkbootfs.c libcutils/dir_hash.c Potential buffer overrun in: gpttool/gpttool.c Incorrect NULL check in: libsparse/backed_block.c Bug: https://code.google.com/p/android/issues/detail?id=61564 Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
Diffstat (limited to 'adb')
-rw-r--r--adb/file_sync_client.c2
-rw-r--r--adb/file_sync_service.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/adb/file_sync_client.c b/adb/file_sync_client.c
index 354d0fb..9fec081 100644
--- a/adb/file_sync_client.c
+++ b/adb/file_sync_client.c
@@ -642,8 +642,8 @@ static int local_build_list(copyinfo **filelist,
ci = mkcopyinfo(lpath, rpath, name, 0);
if(lstat(ci->src, &st)) {
fprintf(stderr,"cannot stat '%s': %s\n", ci->src, strerror(errno));
+ free(ci);
closedir(d);
-
return -1;
}
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 d3e841b..f24f14c 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)
if(writex(s, &msg.dent, sizeof(msg.dent)) ||
writex(s, de->d_name, len)) {
+ closedir(d);
return -1;
}
}