the malloc at ccbase.c:110 is redundant. The following lines do another malloc assigning the result to the same variable without freeing the old value