From 78592d56efaf05a4da94eeb32b4a0ed17f204719 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Thu, 18 Mar 2004 14:18:51 +0000 Subject: [PATCH] Correct a bug introduced with the recent clone API chang: when the clone event handler for if_tap fails, make sure to clean up clone state to prevent a clone memory leak. --- sys/net/if_tap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 17f371d9138..670ac690705 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -150,6 +150,7 @@ tapmodevent(mod, type, data) clone_setup(&tapclones); eh_tag = EVENTHANDLER_REGISTER(dev_clone, tapclone, 0, 1000); if (eh_tag == NULL) { + clone_cleanup(&tapclones); mtx_destroy(&tapmtx); return (ENOMEM); }