/* Process file inputs */
while (gotinputs && !TAILQ_EMPTY(&inputs)) {
+ /* TAILQ_REMOVE does the right thing */
+ /* coverity[use_after_free] */
struct input *first = TAILQ_FIRST(&inputs);
log_debug("lldpctl", "process: %s", first->name);
FILE *file = fopen(first->name, "r");
end:
while (!TAILQ_EMPTY(&inputs)) {
+ /* TAILQ_REMOVE does the right thing */
+ /* coverity[use_after_free] */
struct input *first = TAILQ_FIRST(&inputs);
TAILQ_REMOVE(&inputs, first, next);
free(first->name);
client);
bufferevent_enable(client->bev, EV_READ | EV_WRITE);
log_debug("event", "new client accepted");
+ /* s has been saved by bufferevent_socket_new */
+ /* coverity[leaked_handle] */
return;
accept_failed:
levent_ctl_free_client(client);
}
if (levent_iface_subscribe(cfg, s) == -1)
close(s);
+ /* s has been saved by levent_iface_subscribe */
+ /* coverity[leaked_handle] */
}
end:
size_t output_len;
char save[offsetof(struct lldpd_port, p_id_subtype)];
memcpy(save, port, sizeof(save));
+ /* We intentionally partially memset port */
+ /* coverity[suspicious_sizeof] */
memset(port, 0, sizeof(save));
output_len = lldpd_port_serialize(port, (void**)&output);
memcpy(port, save, sizeof(save));
freed with lldpd_port_cleanup() and therefore, the refcount
of the chassis that was attached to it is decreased.
*/
+ /* TAILQ_REMOVE does the right thing */
+ /* coverity[use_after_free] */
i = 0; TAILQ_FOREACH(aport, &hardware->h_rports, p_entries)
i++;
log_debug("decode", "%d neighbors for %s", i,