summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2020-05-28 17:07:30 +0200
committerSander Vrijders <sander@ouroboros.rocks>2020-05-29 11:13:31 +0200
commit5c12e2efc066f09c0e7ed21ed0bb3a3ce635cb0a (patch)
treef05fa585164f8ae932fd6ed7e1a23b33c9ead69a /src/ipcpd/unicast
parentd68bb3b678e867c69a99f97e26b72715e2b8e57f (diff)
downloadouroboros-5c12e2efc066f09c0e7ed21ed0bb3a3ce635cb0a.tar.gz
ouroboros-5c12e2efc066f09c0e7ed21ed0bb3a3ce635cb0a.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/unicast')
-rw-r--r--src/ipcpd/unicast/psched.c2
1 files changed, 1 insertions, 1 deletions
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;
}
}