Possible patch for memory leak in rlm_wimax
Hi again, We are seeing what I think may be a memory leak inside the rlm_wimax module: Several HMAC_CTX structures are initialised with HMAC_CTX_init(), but only the last one seems to be cleaned up with HMAC_CTX_cleanup(). I've attached a patch which removes the memory leak according to my tests. However, I don't know if my change is correct - whether a single HMAC_CTX should be re-used (as I've done in this patch), or whether a new one should be created and cleaned up for each use. I would appreciate it if someone with more familiarity than me could review this change. Thanks very much, James
James Ballantine wrote:
We are seeing what I think may be a memory leak inside the rlm_wimax module: Several HMAC_CTX structures are initialised with HMAC_CTX_init(), but only the last one seems to be cleaned up with HMAC_CTX_cleanup().
That looks right. The extra calls to HMAC_CTX_init() aren't necessary.
I've attached a patch which removes the memory leak according to my tests. However, I don't know if my change is correct - whether a single HMAC_CTX should be re-used (as I've done in this patch), or whether a new one should be created and cleaned up for each use. I would appreciate it if someone with more familiarity than me could review this change.
The same context can be used for every HMAC. I'll apply a patch. Alan DeKok.
participants (2)
-
Alan DeKok -
James Ballantine