summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2008-12-18 09:06:12 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-12-18 09:06:12 +0000
commit874e5b1209b31e33e3ea64146d559bee5df36e46 (patch)
treee865b652740a044d241931ff507e079478634397
parent78df329e73ab2c618089e73bdb8830c362fec196 (diff)
now freeing buffer of outgoing request as soon as we give up sending request, rather than waiting until new request with same id
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@439 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--develdoc.txt6
-rw-r--r--radsecproxy.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/develdoc.txt b/develdoc.txt
index d3ee6f7..02190de 100644
--- a/develdoc.txt
+++ b/develdoc.txt
@@ -194,14 +194,12 @@ Finally, in sendreply() rq->replybuf is created from rq->msg, and
rq->msg is freed. rq->replybuf is kept so that if a duplicate request
is received later, we can just return rq->replybuf.
-It appears that rq->buf created by sendrq() is stored until the
-request is replaced, it should be freed when replyh replaces rq->msg
-or in freerqoutdata().
+rq->buf is removed by freerqoutdata(), because then we will not try
+to send the request in rq->buf any more.
Request structs should perhaps be freed when they "expire", rather
than wait until a new request with the same ID comes along.
-
x. Transports
struct protodefs protodefs[] contains definitions of the different
diff --git a/radsecproxy.c b/radsecproxy.c
index 6337e57..7edc949 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -942,6 +942,10 @@ void freerqoutdata(struct rqout *rqout) {
if (!rqout)
return;
if (rqout->rq) {
+ if (rqout->rq->buf) {
+ free(rqout->rq->buf);
+ rqout->rq->buf = NULL;
+ }
freerq(rqout->rq);
rqout->rq = NULL;
}