summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2007-09-19 12:59:37 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2007-09-19 12:59:37 +0000
commit601dbb2b70d61e4bc3ab99916e0d4b3e543fdf3b (patch)
tree1e934c98f935366a47c8d08746278504555f2d64
parenta12bb1b93ca74059405087aac4e66386d21a5799 (diff)
fixed alignment problem and a memory leak
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.0@163 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index c217894..57801b9 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1204,12 +1204,14 @@ void radsrv(struct request *rq) {
if (code == RAD_Status_Server) {
respondstatusserver(rq);
+ free(buf);
return;
}
if (!to) {
debug(DBG_INFO, "radsrv: sending reject to %s for %s", rq->from->peer.host, username);
respondreject(rq, realm->message);
+ free(buf);
return;
}
@@ -1351,7 +1353,7 @@ void *clientrd(void *arg) {
if (ATTRVALLEN(attr) <= 4)
break;
- if (((uint16_t *)attr)[1] != 0 || ntohs(((uint16_t *)attr)[2]) != 311) /* 311 == MS */
+ if (attr[2] != 0 || attr[3] != 0 || attr[4] != 1 || attr[5] != 55) /* 311 == MS */
continue;
sublen = ATTRVALLEN(attr) - 4;