Skip to content

Commit

Permalink
nats: safety check on destroy for poll field
Browse files Browse the repository at this point in the history
- GH #3401
  • Loading branch information
miconda committed Apr 5, 2023
1 parent ccdd2ed commit a6caaab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/nats/nats_mod.c
Expand Up @@ -597,7 +597,9 @@ int nats_destroy_workers()
LM_ERR("could not cleanup worker connection\n");
}
}
uv_poll_stop(&pub_worker->poll);
if(pub_worker->poll != NULL) {
uv_poll_stop(&pub_worker->poll);
}
shm_free(pub_worker);
}
}
Expand Down

2 comments on commit a6caaab

@linuxmaniac
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nats_mod.c: In function 'nats_destroy_workers':
nats_mod.c:600:53: error: invalid operands to binary != (have 'uv_poll_t' {aka 'struct uv_poll_s'} and 'void *')
  600 |                                 if(pub_worker->poll != NULL) {
      |                                    ~~~~~~~~~~~~~~~~ ^~
      |                                              |
      |                                              uv_poll_t {aka struct uv_poll_s}
make[3]: *** [../../Makefile.rules:100: nats_mod.o] Error 1

@kamailio-sync
Copy link

@kamailio-sync kamailio-sync commented on a6caaab Apr 6, 2023 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.