unix-socket: address scan-build warning

CC       unix-manager.o
unix-manager.c:258:13: warning: Use of memory after it is freed [unix.Malloc]
  258 |         if (item->fd == fd) {
      |             ^~~~~~~~
1 warning generated.

(cherry picked from commit 39dfcaf1b3)
pull/13848/head
Victor Julien 7 months ago
parent 99fd69830e
commit 2a6cba8792

@ -252,9 +252,10 @@ static void UnixClientFree(UnixClient *c)
static void UnixCommandClose(UnixCommand *this, int fd)
{
UnixClient *item;
UnixClient *safe = NULL;
int found = 0;
TAILQ_FOREACH(item, &this->clients, next) {
TAILQ_FOREACH_SAFE (item, &this->clients, next, safe) {
if (item->fd == fd) {
found = 1;
break;

Loading…
Cancel
Save