Re: [PATCH] member: fix memory leak on error
From: Burakov, Anatoly <hidden>
Date: 2017-12-23 11:55:20
From: Burakov, Anatoly <hidden>
Date: 2017-12-23 11:55:20
On 22-Dec-17 6:33 PM, Wang, Yipeng1 wrote:
quoted
-----Original Message----- From: Burakov, Anatoly Yep, i can see that now. Didn't think to look inside rte_member_free() :/ However, you're creating a race condition there - you're unlocking a tailq, and then locking (and unlocking) it again inside rte_member_free() - it probably needs _thread_unsafe() functions that you can call from behind the lock. --Thank you Anatoly, I realize that rte_member_free does not do anything good here. As a fix, I think the following should work. Is there any other concern?
Yes, that should work. Table creation is the last step that can cause an error, so if we're there, we already know that we couldn't have allocated it, so there's no need to deallocate those, and simple rte_free(setsum) should do. I'll submit a v2? -- Thanks, Anatoly