Merge remote branch 'whot/for-keith'

This commit is contained in:
Keith Packard 2010-11-10 16:58:21 -08:00
commit 4ed4915bc0
28 changed files with 355 additions and 399 deletions

View File

@ -136,65 +136,30 @@ int SProcXIChangeHierarchy(ClientPtr client)
return (ProcXIChangeHierarchy(client));
}
#define SWAPIF(cmd) if (client->swapped) { cmd; }
int
ProcXIChangeHierarchy(ClientPtr client)
static int
add_master(ClientPtr client, xXIAddMasterInfo *c, int flags[MAXDEVICES])
{
DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
xXIAnyHierarchyChangeInfo *any;
int required_len = sizeof(xXIChangeHierarchyReq);
char n;
int rc = Success;
int flags[MAXDEVICES] = {0};
REQUEST(xXIChangeHierarchyReq);
REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq);
if (!stuff->num_changes)
return rc;
any = (xXIAnyHierarchyChangeInfo*)&stuff[1];
while(stuff->num_changes--)
{
SWAPIF(swapl(&any->type, n));
SWAPIF(swaps(&any->length, n));
required_len += any->length;
if ((stuff->length * 4) < required_len)
return BadLength;
switch(any->type)
{
case XIAddMaster:
{
xXIAddMasterInfo* c = (xXIAddMasterInfo*)any;
char* name;
int rc;
SWAPIF(swaps(&c->name_len, n));
name = calloc(c->name_len + 1, sizeof(char));
strncpy(name, (char*)&c[1], c->name_len);
rc = AllocDevicePair(client, name, &ptr, &keybd,
CorePointerProc, CoreKeyboardProc,
TRUE);
CorePointerProc, CoreKeyboardProc, TRUE);
if (rc != Success)
{
free(name);
goto unwind;
}
if (!c->send_core)
ptr->coreEvents = keybd->coreEvents = FALSE;
/* Allocate virtual slave devices for xtest events */
rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd,
ptr, keybd);
rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd);
if (rc != Success)
{
free(name);
DeleteInputDeviceRequest(ptr);
DeleteInputDeviceRequest(keybd);
goto unwind;
}
@ -228,19 +193,23 @@ ProcXIChangeHierarchy(ClientPtr client)
flags[XTestptr->id] |= XISlaveAttached;
flags[XTestkeybd->id] |= XISlaveAttached;
unwind:
free(name);
return rc;
}
break;
case XIRemoveMaster:
static int
remove_master(ClientPtr client, xXIRemoveMasterInfo *r,
int flags[MAXDEVICES])
{
xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any;
DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
int rc = Success;
if (r->return_mode != XIAttachToMaster &&
r->return_mode != XIFloating)
return BadValue;
rc = dixLookupDevice(&ptr, r->deviceid, client,
DixDestroyAccess);
rc = dixLookupDevice(&ptr, r->deviceid, client, DixDestroyAccess);
if (rc != Success)
goto unwind;
@ -252,8 +221,7 @@ ProcXIChangeHierarchy(ClientPtr client)
}
/* XXX: For now, don't allow removal of VCP, VCK */
if (ptr == inputInfo.pointer ||
ptr == inputInfo.keyboard)
if (ptr == inputInfo.pointer || ptr == inputInfo.keyboard)
{
rc = BadDevice;
goto unwind;
@ -261,23 +229,16 @@ ProcXIChangeHierarchy(ClientPtr client)
ptr = GetMaster(ptr, MASTER_POINTER);
rc = dixLookupDevice(&ptr,
ptr->id,
client,
DixDestroyAccess);
rc = dixLookupDevice(&ptr, ptr->id, client, DixDestroyAccess);
if (rc != Success)
goto unwind;
keybd = GetMaster(ptr, MASTER_KEYBOARD);
rc = dixLookupDevice(&keybd,
keybd->id,
client,
DixDestroyAccess);
rc = dixLookupDevice(&keybd, keybd->id, client, DixDestroyAccess);
if (rc != Success)
goto unwind;
XTestptr = GetXTestDevice(ptr);
rc = dixLookupDevice(&XTestptr, XTestptr->id, client,
DixDestroyAccess);
rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess);
if (rc != Success)
goto unwind;
@ -295,8 +256,7 @@ ProcXIChangeHierarchy(ClientPtr client)
newptr,
newkeybd;
rc = dixLookupDevice(&newptr, r->return_pointer,
client, DixAddAccess);
rc = dixLookupDevice(&newptr, r->return_pointer, client, DixAddAccess);
if (rc != Success)
goto unwind;
@ -319,9 +279,7 @@ ProcXIChangeHierarchy(ClientPtr client)
goto unwind;
}
for (attached = inputInfo.devices;
attached;
attached = attached->next)
for (attached = inputInfo.devices; attached; attached = attached->next)
{
if (!IsMaster(attached)) {
if (attached->u.master == ptr)
@ -363,18 +321,22 @@ ProcXIChangeHierarchy(ClientPtr client)
flags[XTestkeybd->id] |= XISlaveRemoved;
flags[keybd->id] |= XIMasterRemoved;
flags[ptr->id] |= XIMasterRemoved;
}
break;
case XIDetachSlave:
{
xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any;
rc = dixLookupDevice(&ptr, c->deviceid, client,
DixManageAccess);
unwind:
return rc;
}
static int
detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES])
{
DeviceIntPtr dev;
int rc;
rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess);
if (rc != Success)
goto unwind;
if (IsMaster(ptr))
if (IsMaster(dev))
{
client->errorValue = c->deviceid;
rc = BadDevice;
@ -382,28 +344,33 @@ ProcXIChangeHierarchy(ClientPtr client)
}
/* Don't allow changes to XTest Devices, these are fixed */
if (IsXTestDevice(ptr, NULL))
if (IsXTestDevice(dev, NULL))
{
client->errorValue = c->deviceid;
rc = BadDevice;
goto unwind;
}
AttachDevice(client, ptr, NULL);
flags[ptr->id] |= XISlaveDetached;
AttachDevice(client, dev, NULL);
flags[dev->id] |= XISlaveDetached;
unwind:
return rc;
}
break;
case XIAttachSlave:
static int
attach_slave(ClientPtr client, xXIAttachSlaveInfo *c,
int flags[MAXDEVICES])
{
xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any;
DeviceIntPtr dev;
DeviceIntPtr newmaster;
int rc;
rc = dixLookupDevice(&ptr, c->deviceid, client,
DixManageAccess);
rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess);
if (rc != Success)
goto unwind;
if (IsMaster(ptr))
if (IsMaster(dev))
{
client->errorValue = c->deviceid;
rc = BadDevice;
@ -411,15 +378,14 @@ ProcXIChangeHierarchy(ClientPtr client)
}
/* Don't allow changes to XTest Devices, these are fixed */
if (IsXTestDevice(ptr, NULL))
if (IsXTestDevice(dev, NULL))
{
client->errorValue = c->deviceid;
rc = BadDevice;
goto unwind;
}
rc = dixLookupDevice(&newmaster, c->new_master,
client, DixAddAccess);
rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess);
if (rc != Success)
goto unwind;
if (!IsMaster(newmaster))
@ -429,16 +395,86 @@ ProcXIChangeHierarchy(ClientPtr client)
goto unwind;
}
if (!((IsPointerDevice(newmaster) &&
IsPointerDevice(ptr)) ||
(IsKeyboardDevice(newmaster) &&
IsKeyboardDevice(ptr))))
if (!((IsPointerDevice(newmaster) && IsPointerDevice(dev)) ||
(IsKeyboardDevice(newmaster) && IsKeyboardDevice(dev))))
{
rc = BadDevice;
goto unwind;
}
AttachDevice(client, ptr, newmaster);
flags[ptr->id] |= XISlaveAttached;
AttachDevice(client, dev, newmaster);
flags[dev->id] |= XISlaveAttached;
unwind:
return rc;
}
#define SWAPIF(cmd) if (client->swapped) { cmd; }
int
ProcXIChangeHierarchy(ClientPtr client)
{
xXIAnyHierarchyChangeInfo *any;
int required_len = sizeof(xXIChangeHierarchyReq);
char n;
int rc = Success;
int flags[MAXDEVICES] = {0};
REQUEST(xXIChangeHierarchyReq);
REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq);
if (!stuff->num_changes)
return rc;
any = (xXIAnyHierarchyChangeInfo*)&stuff[1];
while(stuff->num_changes--)
{
SWAPIF(swapl(&any->type, n));
SWAPIF(swaps(&any->length, n));
required_len += any->length;
if ((stuff->length * 4) < required_len)
return BadLength;
switch(any->type)
{
case XIAddMaster:
{
xXIAddMasterInfo* c = (xXIAddMasterInfo*)any;
SWAPIF(swaps(&c->name_len, n));
rc = add_master(client, c, flags);
if (rc != Success)
goto unwind;
}
break;
case XIRemoveMaster:
{
xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any;
rc = remove_master(client, r, flags);
if (rc != Success)
goto unwind;
}
break;
case XIDetachSlave:
{
xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any;
rc = detach_slave(client, c, flags);
if (rc != Success)
goto unwind;
}
break;
case XIAttachSlave:
{
xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any;
rc = attach_slave(client, c, flags);
if (rc != Success)
goto unwind;
}
break;
}

View File

@ -45,11 +45,6 @@
See the evdev documentation for more information.
You will probably want to add the following option to the ServerFlags of
your xorg.conf:
Option "AllowEmptyInput" "True"
FIXME: Support tablets too.
TODO: I think its fixed, can't test

View File

@ -117,10 +117,7 @@ CreateGrab(
static void
FreeGrab(GrabPtr pGrab)
{
if (pGrab->modifiersDetail.pMask != NULL)
free(pGrab->modifiersDetail.pMask);
if (pGrab->detail.pMask != NULL)
free(pGrab->detail.pMask);
if (pGrab->cursor)

View File

@ -952,11 +952,9 @@ SetAccelerationProfile(
if(profile == NULL && profile_num != PROFILE_UNINITIALIZE)
return FALSE;
if(vel->profile_private != NULL){
/* Here one could free old profile-private data */
free(vel->profile_private);
vel->profile_private = NULL;
}
/* Here one could init profile-private data */
vel->Profile = profile;
vel->statistics.profile_number = profile_num;

View File

@ -1158,9 +1158,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
*/
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0) {
if (screen->base.GLXextensions != NULL) {
free(screen->base.GLXextensions);
}
screen->base.GLXextensions = xnfalloc(buffer_size);
(void) __glXGetExtensionString(screen->glx_enable_bits,

View File

@ -792,9 +792,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
*/
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0) {
if (screen->base.GLXextensions != NULL) {
free(screen->base.GLXextensions);
}
screen->base.GLXextensions = xnfalloc(buffer_size);
(void) __glXGetExtensionString(screen->glx_enable_bits,

View File

@ -346,9 +346,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
cl->GLClientextensions);
buf = __glXcombine_strings(buf1,
cx->pGlxScreen->GLextensions);
if (buf1 != NULL) {
free(buf1);
}
string = buf;
}
else if ( name == GL_VERSION ) {
@ -377,7 +375,6 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
__GLX_SEND_HEADER();
WriteToClient(client, length, (char *) string);
if (buf != NULL)
free(buf);
return Success;

View File

@ -2565,7 +2565,7 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc)
cl->GLClientmajorVersion = req->major;
cl->GLClientminorVersion = req->minor;
if (cl->GLClientextensions) free(cl->GLClientextensions);
free(cl->GLClientextensions);
buf = (const char *)(req+1);
cl->GLClientextensions = strdup(buf);

View File

@ -77,10 +77,10 @@ static void ResetClientState(int clientIndex)
Display **keep_be_displays;
int i;
if (cl->returnBuf) free(cl->returnBuf);
if (cl->currentContexts) free(cl->currentContexts);
if (cl->currentDrawables) free(cl->currentDrawables);
if (cl->largeCmdBuf) free(cl->largeCmdBuf);
free(cl->returnBuf);
free(cl->currentContexts);
free(cl->currentDrawables);
free(cl->largeCmdBuf);
for (i=0; i< screenInfo.numScreens; i++) {
if (cl->be_displays[i])
@ -97,7 +97,7 @@ static void ResetClientState(int clientIndex)
*/
cl->GLClientmajorVersion = 1;
cl->GLClientminorVersion = 0;
if (cl->GLClientextensions) free(cl->GLClientextensions);
free(cl->GLClientextensions);
memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));
}
@ -222,10 +222,10 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
{
if (cx->idExists || cx->isCurrent) return GL_FALSE;
if (cx->feedbackBuf) free(cx->feedbackBuf);
if (cx->selectBuf) free(cx->selectBuf);
if (cx->real_ids) free(cx->real_ids);
if (cx->real_vids) free(cx->real_vids);
free(cx->feedbackBuf);
free(cx->selectBuf);
free(cx->real_ids);
free(cx->real_vids);
if (cx->pGlxPixmap) {
/*

View File

@ -215,11 +215,8 @@ fakeUnmapFramebuffer (KdScreenInfo *screen)
{
FakePriv *priv = screen->card->driver;
KdShadowFbFree (screen);
if (priv->base)
{
free(priv->base);
priv->base = 0;
}
priv->base = NULL;
return TRUE;
}

View File

@ -742,8 +742,6 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
{ FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_ALLOW_EMPTY_INPUT, "AllowEmptyInput", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN,
@ -956,7 +954,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
/* AllowEmptyInput is automatically true if we're hotplugging */
xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
/* AEI on? Then we're not using kbd, so use the evdev rules set. */
#if defined(linux)
@ -1437,8 +1434,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
"reconfigure %s or disable AutoAddDevices.\n",
config_backend, config_backend);
#else
xf86Msg(X_INFO, "Hotplugging is disabled and no input devices were configured.\n"
"\tTry disabling AllowEmptyInput.\n");
xf86Msg(X_WARNING, "Hotplugging requested but the server was "
"compiled without a config backend. "
"No input devices were configured, the server "
"will start without any input devices.\n");
#endif
}
@ -2353,7 +2352,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) {
IDevPtr *current;
if (!warned)
{
xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using "
xf86Msg(X_WARNING, "Hotplugging is on, devices using "
"drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n");
warned = TRUE;
}

View File

@ -558,9 +558,6 @@ Default: off.
This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__)
drivers to not report failure if the mouse device can't be opened/initialised.
It has no effect on the evdev(__drivermansuffix__) or other drivers.
The previous functionality of allowing the server to start up even if
the mouse device can't be opened/initialised is now handled by the
AllowEmptyInput option.
Default: false.
.TP 7
.BI "Option \*qVTSysReq\*q \*q" boolean \*q
@ -677,12 +674,6 @@ default.
Allow modules built for a different, potentially incompatible version of
the X server to load. Disabled by default.
.TP 7
.BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q
If enabled, don't add the standard keyboard and mouse drivers, if there are no
input devices in the config file. Enabled by default if AutoAddDevices and
AutoEnableDevices is enabled, otherwise disabled.
If AllowEmptyInput is on, devices using the kbd, mouse or vmmouse driver are ignored.
.TP 7
.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
If this option is disabled, then no devices will be added from HAL events.
Enabled by default.

View File

@ -2964,7 +2964,6 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
int size;
#endif
if (output->MonInfo != NULL)
free(output->MonInfo);
output->MonInfo = edid_mon;

View File

@ -681,11 +681,8 @@ glxWinScreenProbe(ScreenPtr pScreen)
{
unsigned int buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0)
{
if (screen->base.GLXextensions != NULL)
{
free(screen->base.GLXextensions);
}
screen->base.GLXextensions = xnfalloc(buffer_size);
__glXGetExtensionString(screen->glx_enable_bits, screen->base.GLXextensions);

View File

@ -516,11 +516,8 @@ winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap)
pScreen->blackPixel = 0;
/* Free colormap */
if (ppeColors != NULL)
{
free(ppeColors);
ppeColors = NULL;
}
/* Free the DC */
if (hdc != NULL)

View File

@ -163,11 +163,8 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap);
/* Free the bitmap info header memory */
if (pPixmapPriv->pbmih != NULL)
{
free(pPixmapPriv->pbmih);
pPixmapPriv->pbmih = NULL;
}
/* Free the pixmap memory */
free (pPixmap);

View File

@ -215,7 +215,7 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans)
void miFreeSpanGroup(SpanGroup *spanGroup)
{
if (spanGroup->group != NULL) free(spanGroup->group);
free(spanGroup->group);
}
static void QuickSortSpansX(

View File

@ -92,7 +92,6 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen)
rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth);
if (s->pixmap_data_size < rowbytes) {
if (s->pixmap_data != NULL)
free(s->pixmap_data);
s->pixmap_data_size = rowbytes;

View File

@ -1140,10 +1140,8 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY,
}
}
if (gResizeDeathBits != NULL) {
free(gResizeDeathBits);
gResizeDeathBits = NULL;
}
if (gravity) {
pScreen->CopyWindow = gResizeOldCopyWindowProc;

View File

@ -481,7 +481,6 @@ AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg)
ErrorF("%slast message repeated %d times\n",
prefix != NULL ? prefix : "", nrepeat);
nrepeat = 0;
if (prefix != NULL)
free(prefix);
return AUDIT_TIMEOUT;
} else {
@ -515,7 +514,6 @@ VAuditF(const char *f, va_list args)
nrepeat = 0;
auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL);
}
if (prefix != NULL)
free(prefix);
}

View File

@ -15,8 +15,8 @@
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <sys/types.h>

View File

@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <sys/types.h>

View File

@ -321,17 +321,11 @@ miInitIndexed (ScreenPtr pScreen,
void
miCloseIndexed (ScreenPtr pScreen,
PictFormatPtr pFormat)
{
if (pFormat->index.devPrivate)
{
free(pFormat->index.devPrivate);
pFormat->index.devPrivate = 0;
}
if (pFormat->index.pValues)
{
pFormat->index.devPrivate = NULL;
free(pFormat->index.pValues);
pFormat->index.pValues = 0;
}
pFormat->index.pValues = NULL;
}
void

View File

@ -1390,12 +1390,9 @@ SetPictureTransform (PicturePtr pPicture,
*pPicture->transform = *transform;
}
else
{
if (pPicture->transform)
{
free(pPicture->transform);
pPicture->transform = 0;
}
pPicture->transform = NULL;
}
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;

View File

@ -212,13 +212,11 @@ XkbNamesPtr names;
register XkbKeyTypePtr type;
type= map->types;
for (i=0;i<map->num_types;i++,type++) {
if (type->level_names!=NULL) {
free(type->level_names);
type->level_names = NULL;
}
}
}
}
if ((which&XkbKeyNamesMask)&&(names->keys!=NULL)) {
free(names->keys);
names->keys= NULL;

View File

@ -50,10 +50,8 @@ _XkbFreeGeomLeafElems( Bool freeAll,
{
if ((freeAll)||(*elems==NULL)) {
*num_inout= *sz_inout= 0;
if (*elems!=NULL) {
free(*elems);
*elems = NULL;
}
return;
}
@ -373,23 +371,17 @@ XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in;
switch (doodad->any.type) {
case XkbTextDoodad:
{
if (doodad->text.text!=NULL) {
free(doodad->text.text);
doodad->text.text = NULL;
}
if (doodad->text.font!=NULL) {
free(doodad->text.font);
doodad->text.font = NULL;
}
}
break;
case XkbLogoDoodad:
{
if (doodad->logo.logo_name!=NULL) {
free(doodad->logo.logo_name);
doodad->logo.logo_name = NULL;
}
}
break;
}
return;
@ -434,10 +426,8 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap)
if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL))
XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,TRUE);
if (freeMap) {
if (geom->label_font!=NULL) {
free(geom->label_font);
geom->label_font = NULL;
}
free(geom);
}
return;

View File

@ -292,10 +292,8 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
}
type= &xkb->map->types[type_ndx];
if (map_count==0) {
if (type->map!=NULL)
free(type->map);
type->map= NULL;
if (type->preserve!=NULL)
free(type->preserve);
type->preserve= NULL;
type->map_count= 0;
@ -321,7 +319,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
return BadAlloc;
}
}
else if (type->preserve!=NULL) {
else {
free(type->preserve);
type->preserve = NULL;
}
@ -807,31 +805,23 @@ XkbClientMapPtr map;
register int i;
XkbKeyTypePtr type;
for (i=0,type=map->types;i<map->num_types;i++,type++) {
if (type->map!=NULL) {
free(type->map);
type->map = NULL;
}
if (type->preserve!=NULL) {
free(type->preserve);
type->preserve = NULL;
}
type->map_count= 0;
if (type->level_names!=NULL) {
free(type->level_names);
type->level_names = NULL;
}
}
}
free(map->types);
map->num_types= map->size_types= 0;
map->types= NULL;
}
}
if (what&XkbKeySymsMask) {
if (map->key_sym_map!=NULL) {
free(map->key_sym_map);
map->key_sym_map = NULL;
}
if (map->syms!=NULL) {
free(map->syms);
map->size_syms= map->num_syms= 0;
@ -864,10 +854,8 @@ XkbServerMapPtr map;
map->explicit= NULL;
}
if (what&XkbKeyActionsMask) {
if (map->key_acts!=NULL) {
free(map->key_acts);
map->key_acts = NULL;
}
if (map->acts!=NULL) {
free(map->acts);
map->num_acts= map->size_acts= 0;

View File

@ -267,7 +267,6 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
strncpy(nameRtrn,keymap,nameRtrnLen);
nameRtrn[nameRtrnLen-1]= '\0';
}
if (buf != NULL)
free(buf);
return TRUE;
}
@ -287,7 +286,6 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
}
if (nameRtrn)
nameRtrn[0]= '\0';
if (buf != NULL)
free(buf);
return FALSE;
}