diff options
Diffstat (limited to 'luni')
-rw-r--r-- | luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp b/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp index 9b4bb4d..6ba055a 100644 --- a/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp +++ b/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp @@ -332,6 +332,7 @@ static InternedString** expandInternedStringBucket( memcpy(newBucket, existingBucket, size * sizeof(InternedString*)); newBucket[size] = entry; newBucket[size + 1] = NULL; + delete[] existingBucket; return newBucket; } @@ -385,6 +386,7 @@ static jstring internString(JNIEnv* env, ParsingContext* parsingContext, const c // Expand the bucket. bucket = expandInternedStringBucket(bucket, internedString); if (bucket == NULL) { + delete internedString; jniThrowOutOfMemoryError(env, NULL); return NULL; } @@ -400,6 +402,7 @@ static jstring internString(JNIEnv* env, ParsingContext* parsingContext, const c // Create a new bucket with one entry. bucket = newInternedStringBucket(internedString); if (bucket == NULL) { + delete internedString; jniThrowOutOfMemoryError(env, NULL); return NULL; } |