The setcpu_buf is unconditionally freed at the end of the program. However, there are code paths in which it is not allocated: $ sudo ./cyclicdeadline Using all CPUS /sys/kernel/debug/sched_features: Success interval: 600:1000 Tested at 5us of 600us deadline thread 2963 thread[2963] runtime=600us deadline=1000us main thread 2962 fail 2 0 T: 0 ( 2963) I:1000 C: 1268 Min: 7 Act: 55 Avg: 56 Max: 256 [1] 2961 segmentation fault sudo ./cyclicdeadline Fix it by adding the NULL check. Signed-off-by: Kurt Kanzenbach <kurt@xxxxxxxxxxxxx> --- src/sched_deadline/cyclicdeadline.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c index 08460107c464..614ad54c171f 100644 --- a/src/sched_deadline/cyclicdeadline.c +++ b/src/sched_deadline/cyclicdeadline.c @@ -1261,6 +1261,7 @@ int main (int argc, char **argv) } } - free(setcpu_buf); + if (setcpu_buf) + free(setcpu_buf); return 0; } -- 2.11.0