diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2019-09-19 12:45:07 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2019-09-19 16:06:07 +0200 |
commit | 8b1beddbe4c08e5dd40a73f0bf1b267c8352fa57 (patch) | |
tree | 47d398d29f0381d0beec88287e9edf995abd87f3 /sources/dbi.h | |
parent | c1c89e196c7ecbc91dd1f3237cd546ef633490c4 (diff) |
#915: Fix file descriptor leak in og_socket_server_init() from exit path
Call close() to release the socket in the event of an error.
infer says:
sources/ogAdmServer.cpp:1244: error: RESOURCE_LEAK
resource acquired by call to `socket()` at line 1236, column 6 is not released after line 1244, column 3.
1242. sizeof(on));
1243. if (res < 0) {
1244. > syslog(LOG_ERR, "cannot set broadcast socket\n");
1245. return false;
1246. }
Not a real problem since OS releases process resources if the server
cannot bind to the port, but just to be correct here.
Diffstat (limited to 'sources/dbi.h')
0 files changed, 0 insertions, 0 deletions