summaryrefslogtreecommitdiff
path: root/recipes/xorg-xserver/xserver-xorg-1.8.99.905/0001-xf86Modes-make-sure-that-DisplayModeRec-name-is-init.patch
blob: adbc274fd7c37c2f0680ae277ab12db0285a7a4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 7deb3068ff65ecadf035e8e493d418aca89c9212 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Wed, 30 Jun 2010 10:42:36 +0200
Subject: [PATCH] xf86Modes: make sure that DisplayModeRec name is initialized to NULL and then don't call free() on it in xf86SetModeDefaultName

---
 hw/xfree86/modes/xf86Modes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 05f4319..09a9679 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -206,7 +206,7 @@ xf86DuplicateMode(const DisplayModeRec *pMode)
 {
     DisplayModePtr pNew;
 
-    pNew = xnfalloc(sizeof(DisplayModeRec));
+    pNew = xnfcalloc(1, sizeof(DisplayModeRec));
     *pNew = *pMode;
     pNew->next = NULL;
     pNew->prev = NULL;
-- 
1.7.1