aboutsummaryrefslogtreecommitdiff
path: root/src/lua-nng-aio.c
diff options
context:
space:
mode:
authorAlexander Pickering <alex@cogarr.net>2020-08-21 10:59:52 -0400
committerAlexander Pickering <alex@cogarr.net>2020-08-21 10:59:52 -0400
commitd81c343c9a1dfa49b5d7763835ee8ea45dba53c5 (patch)
tree73283ddf23c318e0f5f5b97542db379b6244d363 /src/lua-nng-aio.c
parent23e08942472787a2df47f2ae5ea1a29f8cbfd576 (diff)
downloadlua-nng-d81c343c9a1dfa49b5d7763835ee8ea45dba53c5.tar.gz
lua-nng-d81c343c9a1dfa49b5d7763835ee8ea45dba53c5.tar.bz2
lua-nng-d81c343c9a1dfa49b5d7763835ee8ea45dba53c5.zip
Fix memory leak
There was a memory leak in the call to recv_any(), which would allocate a condition variable and never free it once per call.
Diffstat (limited to 'src/lua-nng-aio.c')
-rw-r--r--src/lua-nng-aio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua-nng-aio.c b/src/lua-nng-aio.c
index a4f8944..0886233 100644
--- a/src/lua-nng-aio.c
+++ b/src/lua-nng-aio.c
@@ -172,10 +172,10 @@ void push_callback(void *v){
//messages can be thrown out becuase of the canceling of the async recieves.
//recv_any(socket1, socket2, ...) :: socket | false, message | errmsg,
int lnng_aio_recv(lua_State *L){
- nng_mtx *luamtx, *callbackmtx, *setupmtx;
+ nng_mtx *luamtx, *callbackmtx;
int err = nng_mtx_alloc(&luamtx);
err |= nng_mtx_alloc(&callbackmtx);
- err |= nng_mtx_alloc(&setupmtx);
+ /*err |= nng_mtx_alloc(&setupmtx);*/
if(err != 0){
/*printf("Something when wrong when allocating mutexes\n");*/
lua_pushboolean(L,0);