-----Original Message-----
From: Andrey Chernov <[email protected]> Date: 2015-11-20, Friday at 15:20 To: Ravi Pokala <[email protected]>, <[email protected]>, <[email protected]>, <[email protected]> Subject: Re: svn commit: r291114 - head/lib/libc/gen >On 21.11.2015 1:36, Ravi Pokala wrote: >> Move fdopen() up near other resource allocation like malloc(); do proper >> deallocation on failure later on in the function. > >Incorrect. Old code calls fdopen() only in the parent, new one calls >fdopen() before fork(), so its results shared by both parent and child, >which is wrong for child() case. There's two different things at play - userland resources and kernel resources. Both "FILE *iop" and "struct pid *cur" are userland, while the descriptors in "pdes" are kernel. We clean up the descriptors in "pdes" in call cases, so we're not leaking kernel resources. You're right that "iop" (and "cur", which you didn't mention) appear to be leaked in the child, in that they're not explicitly cleaned up. But they get wiped away by the _execve(), so it doesn't matter. -Ravi _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "[email protected]"
