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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user