Module: kamailio
Branch: master
Commit: 1e97d6e63c89c7a27be7152ac38192d056fef7c8
URL:
https://github.com/kamailio/kamailio/commit/1e97d6e63c89c7a27be7152ac38192d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-04-21T20:00:11+02:00
evrexec: free resources in case of failure
---
Modified: src/modules/evrexec/evrexec_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1e97d6e63c89c7a27be7152ac38192d…
Patch:
https://github.com/kamailio/kamailio/commit/1e97d6e63c89c7a27be7152ac38192d…
---
diff --git a/src/modules/evrexec/evrexec_mod.c b/src/modules/evrexec/evrexec_mod.c
index 253197d100..3087e65369 100644
--- a/src/modules/evrexec/evrexec_mod.c
+++ b/src/modules/evrexec/evrexec_mod.c
@@ -259,11 +259,14 @@ void evrexec_process_socket(evrexec_task_t *it, int idx)
if(it->sockfd==-1) {
LM_ERR("failed to create socket - address: %.*s (%d/%s)\n",
it->sockaddr.len, it->sockaddr.s, errno, strerror(errno));
+ freeaddrinfo(res);
return;
}
if(bind(it->sockfd, res->ai_addr, res->ai_addrlen)==-1) {
LM_ERR("failed to bind socket - address: %.*s (%d/%s)\n",
it->sockaddr.len, it->sockaddr.s, errno, strerror(errno));
+ close(it->sockfd);
+ freeaddrinfo(res);
return;
}
freeaddrinfo(res);