ART: Fix clang-analyzer leak/memory warnings
Fix warnings, or make code more obvious to the analyzer.
(The analysis itself is too expensive to force it on for all
local builds.)
Test: mmma art (with clang-analyzer-cplusplus.NewDeleteLeaks)
Change-Id: Id3687eb6f3af3a0b4f2df1422bc6d83650517623
diff --git a/dexlayout/dex_verify.cc b/dexlayout/dex_verify.cc
index 962798d..718d66f 100644
--- a/dexlayout/dex_verify.cc
+++ b/dexlayout/dex_verify.cc
@@ -918,7 +918,7 @@
*error_msg = "DebugInfo null/non-null mismatch.";
return false;
}
- if (memcmp(orig_data, output_data, orig_size) != 0) {
+ if (orig_data != nullptr && memcmp(orig_data, output_data, orig_size) != 0) {
*error_msg = "DebugInfo bytes mismatch.";
return false;
}