projects
/
oweals
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4c9074
)
fix a memory leak
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 19 Mar 2012 20:18:52 +0000
(21:18 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 19 Mar 2012 20:18:52 +0000
(21:18 +0100)
device.c
patch
|
blob
|
history
tunnel.c
patch
|
blob
|
history
diff --git
a/device.c
b/device.c
index 1d842cf8e085fcd28081823aaa70c06cd6ae4e93..46177a2728cb3488012df7963cf623311a750afa 100644
(file)
--- a/
device.c
+++ b/
device.c
@@
-482,6
+482,7
@@
void
device_free(struct device *dev)
{
__devlock++;
+ free(dev->config);
dev->type->free(dev);
__devlock--;
}
diff --git
a/tunnel.c
b/tunnel.c
index b6e902a1fdaacd53ef536611a95465abcf1d97d2..b45ac98919167230cf06a627acc741689c51f31d 100644
(file)
--- a/
tunnel.c
+++ b/
tunnel.c
@@
-6,7
+6,6
@@
struct tunnel {
struct device dev;
device_state_cb set_state;
- struct blob_attr *config;
};
static int
@@
-16,7
+15,7
@@
tunnel_set_state(struct device *dev, bool up)
int ret;
if (up) {
- ret = system_add_ip_tunnel(dev->ifname,
tun
->config);
+ ret = system_add_ip_tunnel(dev->ifname,
dev
->config);
if (ret != 0)
return ret;
}
@@
-36,7
+35,6
@@
tunnel_create(const char *name, struct blob_attr *attr)
tun = calloc(1, sizeof(*tun));
dev = &tun->dev;
- tun->config = config_memdup(attr);
device_init(dev, &tunnel_device_type, name);
tun->set_state = dev->set_state;
dev->set_state = tunnel_set_state;