am fa351ab2: Only do bugreport on user build with ADB enabled

* commit 'fa351ab265957fa8815df3c4ca1f3c105f253e8b':
  Only do bugreport on user build with ADB enabled
diff --git a/ext4_utils/ext4_utils.c b/ext4_utils/ext4_utils.c
index d41b92d..3d5895e 100644
--- a/ext4_utils/ext4_utils.c
+++ b/ext4_utils/ext4_utils.c
@@ -460,6 +460,7 @@
 #elif defined(__APPLE__) && defined(__MACH__)
 	ret = ioctl(fd, DKIOCGETBLOCKCOUNT, &size);
 #else
+	close(fd);
 	return 0;
 #endif
 
diff --git a/ext4_utils/output_file.c b/ext4_utils/output_file.c
index 39a6007..d7cf91b 100644
--- a/ext4_utils/output_file.c
+++ b/ext4_utils/output_file.c
@@ -355,6 +355,7 @@
 	zero_buf = malloc(info.block_size);
 	if (!zero_buf) {
 		error_errno("malloc zero_buf");
+		free(out);
 		return NULL;
 	}
 	memset(zero_buf, '\0', info.block_size);
@@ -547,10 +548,6 @@
 			goto err;
 	}
 
-	munmap(data, len);
-
-	close(file_fd);
-
 err:
 	munmap(data, len);
 	close(file_fd);