mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8311645: Memory leak in jspawnhelper spawnChild after JDK-8307990
Reviewed-by: shade, simonis, alanb, rriggs
This commit is contained in:
parent
e154b0d6cd
commit
401c3dea5d
1 changed files with 2 additions and 0 deletions
|
@ -562,6 +562,7 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath)
|
|||
|
||||
/* write the two structs and the data buffer */
|
||||
if (writeFully(c->childenv[1], (char *)&magic, sizeof(magic)) != sizeof(magic)) { // magic number first
|
||||
free(buf);
|
||||
return -1;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
|
@ -570,6 +571,7 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath)
|
|||
if (writeFully(c->childenv[1], (char *)c, sizeof(*c)) != sizeof(*c) ||
|
||||
writeFully(c->childenv[1], (char *)&sp, sizeof(sp)) != sizeof(sp) ||
|
||||
writeFully(c->childenv[1], buf, bufsize) != bufsize) {
|
||||
free(buf);
|
||||
return -1;
|
||||
}
|
||||
/* We're done. Let jspwanhelper know he can't expect any more data from us. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue