Re: [PATCH v2] tty: vt: fix memory leak in vc_allocate()
From: Mingyu Wang
Date: Mon Aug 03 2026 - 10:49:02 EST
Hi Greg,
Shouldn't you be checking vc->uni_pagedict_loc before calling this
function?
Right now we have callers sometimes checking this, and sometimes not,
while the function doesn't seem to care, but we should be consistant,
right? This will only need to be cleaned up if the previous check in
this function was correct.
Thank you for the review.
Yes, the previous check in this function is correct. It acts as a
conditional initialization, allocating the default map only if the VC
did not already inherit one during visual_init().
While con_free_unimap() safely handles NULL internally, I completely
agree that keeping the callers consistent is better for readability
and maintenance.
I will add the explicit check for *vc->uni_pagedict_loc in the
err_free path and send a v3 shortly.
Best regards,
Mingyu Wang