jobject jhost; /* global reference to the java host instance returned */
/* get the C string from the java string */
- const char *name = (*env)->GetStringUTFChars(env, jname, 0);
- if (name == NULL) {
+ if (jname == NULL) {
jxbt_throw_null(env,bprintf("No host can have a null name"));
return NULL;
}
+ const char *name = (*env)->GetStringUTFChars(env, jname, 0);
/* get the host by name (the hosts are created during the grid resolution) */
host = MSG_get_host_by_name(name);
const char *value_java = (*env)->GetStringUTFChars(env, jvalue, 0);
char *value = strdup(value_java);
- MSG_host_set_property_value(host,name,value,xbt_free);
+ MSG_host_set_property_value(host, name, value, xbt_free_f);
(*env)->ReleaseStringUTFChars(env, jvalue, value);
(*env)->ReleaseStringUTFChars(env, jname, name);