From 5c12e2efc066f09c0e7ed21ed0bb3a3ce635cb0a Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 28 May 2020 17:07:30 +0200 Subject: ipcpd: Fix bad index in packet scheduler GCC 10 static analyzer found that the wrong index was used in the fail path of psched_create, causing double (multiple) frees. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/psched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipcpd/unicast/psched.c b/src/ipcpd/unicast/psched.c index 1ac3fc12..898e6b27 100644 --- a/src/ipcpd/unicast/psched.c +++ b/src/ipcpd/unicast/psched.c @@ -160,7 +160,7 @@ struct psched * psched_create(next_packet_fn_t callback) for (j = 0; j < i; ++j) pthread_join(psched->readers[j], NULL); for (j = i; j < QOS_CUBE_MAX * IPCP_SCHED_THR_MUL; ++j) - free(infos[i]); + free(infos[j]); goto fail_infos; } } -- cgit v1.2.3