Fixed memory leak in allocation of markers