summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2017-07-30 20:33:47 +0200
committerLinus Nordberg <linus@nordu.net>2017-07-30 20:34:19 +0200
commit3ecfe22e45031757e95358b7b019ac8d38418518 (patch)
treee0b7a8551c866cc904155b3b049de1d800e2a3e0
parent6c8491ba7ceb656b0d5b329490a4b90c91fb3538 (diff)
maketlv() makes a copy of v, so free it.
coverity: 1449503
-rw-r--r--radsecproxy.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 7029d8a..becc2d4 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1130,9 +1130,8 @@ makevendortlv(uint32_t vendor, struct tlv *attr)
tlv2buf(v + 4, attr);
v[5] += 2; /* Vendor length increased for type and length fields. */
newtlv = maketlv(RAD_Attr_Vendor_Specific, l, v);
- if (newtlv == NULL)
- free(v);
- else
+ free(v);
+ if (newtlv)
freetlv(attr);
}
return newtlv;