From 7ca6fd0dca02f7abdd8808db78357743bbdd23a5 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 29 Mar 2010 20:51:48 -0700 Subject: Fix a bug, and protect against an unrelated class of bugs. If the Java array allocation in InetAddress.cpp failed, we'd free NULL instead of the previously-allocated structure. This is a new bug in froyo, but only happens in out of memory situations, so doesn't seem worth fixing there. Unrelatedly, let's disallow assignment and copying of all our RAII classes. This isn't a mistake I've seen made, but it's easy to protect against, so we may as well do so consistently. Change-Id: I2433b31ff983d388788b09e59e08d661f1725ecd --- xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xml/src') diff --git a/xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp b/xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp index b893309..d4fc557 100644 --- a/xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp +++ b/xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp @@ -562,6 +562,10 @@ private: mPrefix = ""; } } + + // Disallow copy and assignment. + ExpatElementName(const ExpatElementName&); + void operator=(const ExpatElementName&); }; /** -- cgit v1.1