Update output.c

Fixed memory leak in saveoutput() where temporary array "x" was allocated but never freed