> -----Original Message-----
> From: Tommi Rantala [mailto:[email protected]]
> Sent: Thursday, December 21, 2017 07:39
> To: Ying Xue <[email protected]>; tipc-
> [email protected]; Jon Maloy <[email protected]>
> Subject: Re: [tipc-discussion] [PATCH 1/2] tipc: fix memory leak in
> tipc_enable_bearer() if enable_media() fails
> 
> On 21.12.2017 13:04, Ying Xue wrote:
> > Good catch. But after I take a closer look at the code, it's found
> > there are another similar memory leak in tipc_enable_bearer():
> >
> >          if (tipc_mon_create(net, bearer_id))
> >                  return -ENOMEM;
> >
> > So I suggest you should solve it together with it.
> 
> Thanks! How about this?
> 
> -       if (tipc_mon_create(net, bearer_id))
> +       if (tipc_mon_create(net, bearer_id)) {
> +               bearer_disable(net, b);
>                  return -ENOMEM;
> +       }
> 
> Tested it briefly, seems to work.
> I can post it as a separate patch.

I think you can post this together with together with your patch #1. After all, 
it is just fixing two instances of the same problem in the same function.

Acked-by: Jon

> 
> Tommi
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to