summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tap.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-03-18 14:18:51 +0000
committerrwatson <rwatson@FreeBSD.org>2004-03-18 14:18:51 +0000
commit7bdc346d082bdf5d7aa75bf44d51572f0a88360e (patch)
tree8ff9ca025b249ff67e0ce15c64726507cda10375 /sys/net/if_tap.c
parentf70d3556e39dcdad5a9f1542dcd0854c69efa694 (diff)
downloadFreeBSD-src-7bdc346d082bdf5d7aa75bf44d51572f0a88360e.zip
FreeBSD-src-7bdc346d082bdf5d7aa75bf44d51572f0a88360e.tar.gz
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.
Diffstat (limited to 'sys/net/if_tap.c')
-rw-r--r--sys/net/if_tap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index 17f371d..670ac69 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);
}
OpenPOWER on IntegriCloud