Fix coverity issues (#16873)
Stelios Fragkakis committed
Jan 30, 2024 at 10:46 UTC
5124aefc2b78ddc227c9117f092e4ec1a805ca9b
1 file changed
+2
collectors/plugins.d/local-sockets.h
+2
@@ -300,6 +300,7 @@ static inline bool local_sockets_find_all_sockets_in_proc(LS_STATE *ls, const ch
300
pid_t pid = (pid_t)strtoul(proc_entry->d_name, NULL, 10);
301
if(!pid) {
302
local_sockets_log(ls, "cannot parse pid of '%s'", proc_entry->d_name);
303
+ closedir(fd_dir);
304
continue;
305
}
306
net_ns_inode = 0;
@@ -746,6 +747,7 @@ static inline bool local_sockets_get_namespace_sockets(LS_STATE *ls, struct pid_
747
int pipefd[2];
748
if (pipe(pipefd) != 0) {
749
local_sockets_log(ls, "cannot create pipe");
750
+ close(fd);
751
return false;
752
}
753