8303071: Memory leaks in libjdwp

Reviewed-by: sspitsyn
This commit is contained in:
Justin King 2023-02-23 15:23:03 +00:00
parent f113b04ab9
commit 2cf8b8607d
2 changed files with 6 additions and 1 deletions

View File

@ -508,7 +508,7 @@ transport_startTransport(jboolean isServer, char *name, char *address,
trans = info->transport;
if (isServer) {
char *retAddress;
char *retAddress = NULL;
char *launchCommand;
jvmtiError error;
int len;
@ -607,9 +607,13 @@ transport_startTransport(jboolean isServer, char *name, char *address,
name, retAddress));
}
}
jvmtiDeallocate(retAddress);
return JDWP_ERROR(NONE);
handleError:
if (retAddress != NULL) {
jvmtiDeallocate(retAddress);
}
freeTransportInfo(info);
} else {
/*

View File

@ -243,6 +243,7 @@ util_initialize(JNIEnv *env)
}
localSystemThreadGroup = groups[0];
saveGlobalRef(env, localSystemThreadGroup, &(gdata->systemThreadGroup));
jvmtiDeallocate(groups);
/* Get some basic Java property values we will need at some point */
gdata->property_java_version