]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: fix opaque data memleak 10406/head
authorIgor Ryzhov <iryzhov@nfware.com>
Sun, 23 Jan 2022 12:39:04 +0000 (15:39 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Sun, 23 Jan 2022 12:39:04 +0000 (15:39 +0300)
Opaque data should be freed together with route entry in case of errors.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
zebra/zapi_msg.c

index 421438a05113dde69edfc52e3f4336767cf6780e..37c4b76bb3dc44a023764fc6f0ee16fc6ffcd322 100644 (file)
@@ -2093,6 +2093,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
                          __func__);
                nexthop_group_delete(&ng);
                zebra_nhg_backup_free(&bnhg);
+               XFREE(MTYPE_OPAQUE, re->opaque);
                XFREE(MTYPE_RE, re);
                return;
        }
@@ -2105,6 +2106,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
                          __func__, api.safi);
                nexthop_group_delete(&ng);
                zebra_nhg_backup_free(&bnhg);
+               XFREE(MTYPE_OPAQUE, re->opaque);
                XFREE(MTYPE_RE, re);
                return;
        }
@@ -2133,6 +2135,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
         */
        if (ret == -1) {
                client->error_cnt++;
+               XFREE(MTYPE_OPAQUE, re->opaque);
                XFREE(MTYPE_RE, re);
        }