What for do you need malloc()? From what I see, your function TMA_Slope_RSI is just "RSI(series(TMASlope(0))+shift,period);" - if I have not misunderstood it.

The Zorro Trima is the TMA, but I am not sure if the MT4 TMA is the TMA. MT4 indicators often produce different results than the real indicators they are named after.