mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-18 07:10:29 +01:00
xfree86/common: Remove a configScreen leak when conf_screen is NULL
configScreen used a dynamically allocated buffer for XF86ConfScreenRec
when conf_screen argument was NULL. This pointer was never stored
anywhere, nor was it released, so this patch makes the function use
automatically allocated storage in that situation.
[ajax: minor grammar fix]
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
(cherry picked from commit a19771e433)
This commit is contained in:
parent
efe69b4555
commit
aef58ce5ba
1 changed files with 3 additions and 1 deletions
|
|
@ -1787,9 +1787,11 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
|
|||
XF86ConfDisplayPtr dispptr;
|
||||
XF86ConfAdaptorLinkPtr conf_adaptor;
|
||||
Bool defaultMonitor = FALSE;
|
||||
XF86ConfScreenRec local_conf_screen;
|
||||
|
||||
if (!conf_screen) {
|
||||
conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec));
|
||||
memset(&local_conf_screen, 0, sizeof(local_conf_screen));
|
||||
conf_screen = &local_conf_screen;
|
||||
conf_screen->scrn_identifier = "Default Screen Section";
|
||||
xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue