]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
coverity: change a bit the annotations
authorVincent Bernat <vincent@bernat.im>
Tue, 8 Apr 2014 07:32:02 +0000 (09:32 +0200)
committerVincent Bernat <vincent@bernat.im>
Tue, 8 Apr 2014 07:32:02 +0000 (09:32 +0200)
We want coverity to ignore those errors. It doesn't seem to be the case.

src/client/lldpcli.c
src/daemon/event.c
src/daemon/interfaces-linux.c
src/daemon/lldpd.c

index aa30216d32b7436bb97d4ff3e11875daa5f61a81..bdc2c9265472f286423639deab29669eee5abcb8 100644 (file)
@@ -473,8 +473,8 @@ main(int argc, char *argv[])
 
        /* Process file inputs */
        while (gotinputs && !TAILQ_EMPTY(&inputs)) {
-               /* TAILQ_REMOVE does the right thing */
-               /* coverity[use_after_free] */
+               /* coverity[use_after_free]
+                  TAILQ_REMOVE does the right thing */
                struct input *first = TAILQ_FIRST(&inputs);
                log_debug("lldpctl", "process: %s", first->name);
                FILE *file = fopen(first->name, "r");
@@ -556,8 +556,8 @@ main(int argc, char *argv[])
 
 end:
        while (!TAILQ_EMPTY(&inputs)) {
-               /* TAILQ_REMOVE does the right thing */
-               /* coverity[use_after_free] */
+               /* coverity[use_after_free]
+                  TAILQ_REMOVE does the right thing */
                struct input *first = TAILQ_FIRST(&inputs);
                TAILQ_REMOVE(&inputs, first, next);
                free(first->name);
index c05a3b3e01cee4e51da4fe9f573e083c899de0aa..8c5c3b4a524afff2630af6fe266ff9b06e26a728 100644 (file)
@@ -373,8 +373,8 @@ levent_ctl_accept(evutil_socket_t fd, short what, void *arg)
            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] */
+       /* coverity[leaked_handle]
+          s has been saved by bufferevent_socket_new */
        return;
 accept_failed:
        levent_ctl_free_client(client);
index 752897840d9b485140c21d9fc8fe0f7eafbc96c4..72cf71fade9b4f289e3f1fe091a9da2001c4b13e 100644 (file)
@@ -807,8 +807,8 @@ interfaces_update(struct lldpd *cfg)
                }
                if (levent_iface_subscribe(cfg, s) == -1)
                        close(s);
-               /* s has been saved by levent_iface_subscribe */
-               /* coverity[leaked_handle] */
+               /* coverity[leaked_handle]
+                  s has been saved by levent_iface_subscribe */
        }
 
 end:
index 833099346093099e7f16cf555438c6a51accae94..76951c19c43ca123faf8dbec9c099f5154b5efbb 100644 (file)
@@ -301,8 +301,8 @@ lldpd_reset_timer(struct lldpd *cfg)
                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] */
+               /* coverity[suspicious_sizeof]
+                  We intentionally partially memset port */
                memset(port, 0, sizeof(save));
                output_len = lldpd_port_serialize(port, (void**)&output);
                memcpy(port, save, sizeof(save));
@@ -579,8 +579,8 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s,
           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] */
+       /* coverity[use_after_free]
+          TAILQ_REMOVE does the right thing */
        i = 0; TAILQ_FOREACH(aport, &hardware->h_rports, p_entries)
                i++;
        log_debug("decode", "%d neighbors for %s", i,