summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-05-27 22:57:14 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-05-27 22:57:14 +0000
commit3a82762f3cb7a8fa7544c777cc2b5955bfeaee93 (patch)
tree7d6e32f72b1f526b82091762a7021350b62039e2
parenta5d8f0873adc755a360bb4b8d2ffcedc3f41254a (diff)
add missing free on error. thanks to Andrey Matveev.
-rw-r--r--sys/net/if_trunk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c
index c7b8d42a4c5..8ca077eb43e 100644
--- a/sys/net/if_trunk.c
+++ b/sys/net/if_trunk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_trunk.c,v 1.2 2005/05/24 07:51:53 reyk Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.3 2005/05/27 22:57:13 reyk Exp $ */
/*
* Copyright (c) 2005 Reyk Floeter <reyk@vantronix.net>
@@ -116,8 +116,10 @@ trunk_clone_create(struct if_clone *ifc, int unit)
for (i = 0; trunk_protos[i].ti_proto != TRUNK_PROTO_NONE; i++) {
if (trunk_protos[i].ti_proto == TRUNK_PROTO_DEFAULT) {
tr->tr_proto = trunk_protos[i].ti_proto;
- if ((error = trunk_protos[i].ti_attach(tr)) != 0)
+ if ((error = trunk_protos[i].ti_attach(tr)) != 0) {
+ free(tr, M_DEVBUF);
return (error);
+ }
break;
}
}