Fix coverity ID 1270164
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>
Этот коммит содержится в:
родитель
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;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user