for single linked list you can just use an array of the struct and borrow/return via circular list.
my C is beyond the rust levels of 20y Golf 2 but I guess I won't sweat over.
An alternative solution would be cheating away and using realloc instead of malloc.
Oh yeah? How about I just don't use malloc then: