C code fixes: explicit (void) parameter on some functions because compilers complain; fixed memory leaks