diff mbox series

[ovs-dev] ovn-northd-ddlog: Fix minor memory leak.

Message ID 20210310003622.204188-1-blp@ovn.org
State Accepted
Headers show
Series [ovs-dev] ovn-northd-ddlog: Fix minor memory leak. | expand

Commit Message

Ben Pfaff March 10, 2021, 12:36 a.m. UTC
This string is allocated in northd_ctx_create() but until now it was
not freed.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reported-by: Numan Siddique <numans@ovn.org>
---
 northd/ovn-northd-ddlog.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Numan Siddique March 24, 2021, 6:22 a.m. UTC | #1
On Wed, Mar 10, 2021 at 6:06 AM Ben Pfaff <blp@ovn.org> wrote:
>
> This string is allocated in northd_ctx_create() but until now it was
> not freed.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> Reported-by: Numan Siddique <numans@ovn.org>

Acked-by: Numan Siddique <numans@ovn.org>

Numan

> ---
>  northd/ovn-northd-ddlog.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/northd/ovn-northd-ddlog.c b/northd/ovn-northd-ddlog.c
> index 4efdfa38749a..c98bded71b5f 100644
> --- a/northd/ovn-northd-ddlog.c
> +++ b/northd/ovn-northd-ddlog.c
> @@ -200,6 +200,7 @@ northd_ctx_destroy(struct northd_ctx *ctx)
>      if (ctx) {
>          ovsdb_cs_destroy(ctx->cs);
>          json_destroy(ctx->output_only_data);
> +        free(ctx->prefix);
>          free(ctx);
>      }
>  }
> --
> 2.29.2
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Ben Pfaff March 24, 2021, 9:30 p.m. UTC | #2
On Wed, Mar 24, 2021 at 11:52:47AM +0530, Numan Siddique wrote:
> On Wed, Mar 10, 2021 at 6:06 AM Ben Pfaff <blp@ovn.org> wrote:
> >
> > This string is allocated in northd_ctx_create() but until now it was
> > not freed.
> >
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> > Reported-by: Numan Siddique <numans@ovn.org>
> 
> Acked-by: Numan Siddique <numans@ovn.org>

Thanks, applied to master.
diff mbox series

Patch

diff --git a/northd/ovn-northd-ddlog.c b/northd/ovn-northd-ddlog.c
index 4efdfa38749a..c98bded71b5f 100644
--- a/northd/ovn-northd-ddlog.c
+++ b/northd/ovn-northd-ddlog.c
@@ -200,6 +200,7 @@  northd_ctx_destroy(struct northd_ctx *ctx)
     if (ctx) {
         ovsdb_cs_destroy(ctx->cs);
         json_destroy(ctx->output_only_data);
+        free(ctx->prefix);
         free(ctx);
     }
 }