Should I free the allocated string after passing it to NewStringUTF()?
NewStringUTF()
I have some code similar to:
You just need DeleteLocalRef(), NewStringUTF() is just malloc memory on JVM, which the JVM will take care of the memory.
DeleteLocalRef()
malloc