{grad,main}.c: Corrige memory leaks identificados com Valgrind

Signed-off-by: Aryane Ast dos Santos <aryaneast@gmail.com>