XmlBlock: Avoid potential NULL dereference
We move our dereference after the NULL check. Test: TreeHugger Change-Id: I8334be8faf67752e9c0dddf97b133b92b4a7f345
This commit is contained in:
@@ -81,12 +81,12 @@ static jlong android_content_XmlBlock_nativeCreateParseState(JNIEnv* env, jobjec
|
||||
}
|
||||
|
||||
ResXMLParser* st = new ResXMLParser(*osb);
|
||||
st->setSourceResourceId(res_id);
|
||||
if (st == NULL) {
|
||||
jniThrowException(env, "java/lang/OutOfMemoryError", NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
st->setSourceResourceId(res_id);
|
||||
st->restart();
|
||||
|
||||
return reinterpret_cast<jlong>(st);
|
||||
|
||||
Reference in New Issue
Block a user