1
1
The sargs array and its elements were malloced but not freed. Note
that strings passed to NewStringUTF are copied into Java's heap and it
is the callers responsibility to free the original string.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
Nathan Hjelm 2015-05-21 10:13:17 -06:00
родитель 96cd42699e
Коммит 757c021951

Просмотреть файл

@ -300,8 +300,11 @@ JNIEXPORT jobjectArray JNICALL Java_mpi_MPI_Init_1jni(
jstring jc = (*env)->NewStringUTF(env, sargs[i]);
(*env)->SetObjectArrayElement(env, value, i, jc);
(*env)->DeleteLocalRef(env, jc);
free (sargs[i]);
}
free (sargs);
findClasses(env);
initFreeList();
return value;