eal: fix memory leak on control thread failure
params is not freed if pthread_create() fails. The fix is
straight-forward.
Fixes: 3d09a6e26d
("eal: fix threads block on barrier")
Reported-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
This commit is contained in:
parent
af7551e2bf
commit
e87923a9be
@ -178,8 +178,10 @@ rte_ctrl_thread_create(pthread_t *thread, const char *name,
|
||||
pthread_barrier_init(¶ms->configured, NULL, 2);
|
||||
|
||||
ret = pthread_create(thread, attr, rte_thread_init, (void *)params);
|
||||
if (ret != 0)
|
||||
if (ret != 0) {
|
||||
free(params);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (name != NULL) {
|
||||
ret = rte_thread_setname(*thread, name);
|
||||
|
Loading…
Reference in New Issue
Block a user