mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
dtinfo: Fix a segmentation fault.
The return value from CanvasRenderer::_dofont is a pointer. It will be passed to the free function. Ensure that pointer always points to a dynamically allocated memory to avoid segmentation faults.
This commit is contained in:
parent
35c35d2b3c
commit
3909c8dbcc
1 changed files with 1 additions and 1 deletions
|
@ -621,7 +621,7 @@ CanvasRenderer::_dofont(const FeatureSet &fs, Symbol** symbols)
|
||||||
// if we still can't find one go with whatever.
|
// if we still can't find one go with whatever.
|
||||||
|
|
||||||
else {
|
else {
|
||||||
xlfd = (char*)"-*-*-*-*-*-*-*-*-*-*-*-*-*";
|
xlfd = strdup("-*-*-*-*-*-*-*-*-*-*-*-*-*");
|
||||||
}
|
}
|
||||||
#ifdef FONT_DEBUG
|
#ifdef FONT_DEBUG
|
||||||
fprintf(stderr, "resulting in \"%s\".\n", xlfd);
|
fprintf(stderr, "resulting in \"%s\".\n", xlfd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue