Fix OOM issue in find_comp()