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:
parent
1e47ef4006
commit
2b9ccde53a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue