(!1967) dix: dixfonts: explain analyzer false alarm on alleged free() of stack chunk

The analyzer is wrong here, because the free'd closure pointer really points
to some calloc()'d chunk, instead of the PolyText()'s stack frame.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-06 15:56:58 +02:00
parent 7dd92b77bc
commit 83445aa080

View File

@ -1348,6 +1348,10 @@ doPolyText(ClientPtr client, PTclosurePtr c)
FreeScratchGC(c->pGC);
free(c->data);
/* if compiler/ananylzer warns here, it's a false alarm:
here `c` points to a calloc()ed chunk, not the on-stack struct
from PolyText(). */
free(c);
}
return TRUE;
@ -1494,6 +1498,9 @@ doImageText(ClientPtr client, ITclosurePtr c)
FreeScratchGC(c->pGC);
free(c->data);
/* if compiler/ananylzer warns here, it's a false alarm:
here `c` points to a calloc()ed chunk, not the on-stack struct
from PolyText(). */
free(c);
}
return TRUE;