Avoid leaking unattached socket objects on restore

Dan Smith danms at us.ibm.com
Tue Sep 15 09:52:09 PDT 2009

When we restore socket objects that are not attached to a file, we leak
the struct socket object because only an fput(file) results in the
necessary sock_release().

This set provides a proposed solution to that problem by adding a cleanup
operation to the objhash operations structure which is called at objhash
teardown time.  This gives us the opportunity to call sock_release() on
sockets that we have put into the hash that were never attached to a file
and thus avoid the leak.

More information about the Containers mailing list