summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2017-07-30 20:33:47 +0200
committerLinus Nordberg <linus@nordu.net>2017-08-01 18:10:17 +0200
commitf049ddb9126195789f61f1127cf2ebaf8fe3950f (patch)
tree6cc69778cc4f89e223dc2c58515915406d9dcfef
parent545ff94f4b7adfd46306b5356b19f2ab6597b4ec (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 dbb2576..a52f6aa 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1054,9 +1054,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;