insmod: fix memory leak

insmod makes a half-successful attempt to clean up on failure.  Let's
make it clean up on all failures, and remember to clean up on success
as well.

This leaves modprobe as the only leaky program, at least for the code
paths executed by the test suite.

Signed-off-by: Alan Jenkins <>
1 file changed