[PATCH 02/10] kdrive: Xv code expects attribute names to be allocated each generation

Keith Packard keithp at keithp.com
Thu Mar 13 23:29:55 PDT 2014


Xv frees the attribute names for each X server generation; reset the
server twice without allocating them  again and you get malloc
complaints (or worse).

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/kdrive/src/kxv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index 6f3d85e..f5b1e8a 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -371,6 +371,7 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number)
             for (pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i =
                  0; i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) {
                 memcpy(pat, attributePtr, sizeof(*pat));
+                pat->name = strdup(pAttribute->name);
             }
             pa->nAttributes = adaptorPtr->nAttributes;
             pa->pAttributes = pAttribute;
-- 
1.9.0



More information about the xorg-devel mailing list