summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-10-29 15:58:30 +0100
committerFelix Fietkau <nbd@openwrt.org>2015-10-29 15:58:31 +0100
commitbb99e8017b5b99e5ccd2c05c11b516b6e629ab20 (patch)
treec336b79de74a820d0108413b7fe46c880f5727da
parentc87bc036071886feee5539ded847f1e9d72986de (diff)
system-linux: fix memory leak in system_addr()
Detected by Coverity CID 1330178 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--system-linux.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/system-linux.c b/system-linux.c
index f51c078..27c0f1e 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1532,8 +1532,10 @@ static int system_addr(struct device *dev, struct device_addr *addr, int cmd)
if (addr->valid_until) {
int64_t valid = addr->valid_until - now;
- if (valid <= 0)
+ if (valid <= 0) {
+ nlmsg_free(msg);
return -1;
+ }
else if (valid > UINT32_MAX)
valid = UINT32_MAX;