mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user