Seg fault when freeing an optarged variable