Merge remote branch 'dottedmag/for-keithp'
This commit is contained in:
commit
a41d6e9bff
|
@ -133,7 +133,7 @@ add_option(InputOption **options, const char *key, const char *value)
|
|||
*options = calloc(sizeof(**options), 1);
|
||||
if (!*options) /* Yeesh. */
|
||||
return;
|
||||
(*options)->key = xstrdup(key);
|
||||
(*options)->value = xstrdup(value);
|
||||
(*options)->key = strdup(key);
|
||||
(*options)->value = strdup(value);
|
||||
(*options)->next = NULL;
|
||||
}
|
||||
|
|
|
@ -86,8 +86,8 @@ add_device(DBusMessage *message, DBusMessage *reply, DBusError *error)
|
|||
return BadAlloc;
|
||||
}
|
||||
|
||||
options->key = xstrdup("_source");
|
||||
options->value = xstrdup("client/dbus");
|
||||
options->key = strdup("_source");
|
||||
options->value = strdup("client/dbus");
|
||||
if (!options->key || !options->value) {
|
||||
ErrorF("[config/dbus] couldn't allocate first key/value pair\n");
|
||||
ret = BadAlloc;
|
||||
|
@ -120,7 +120,7 @@ add_device(DBusMessage *message, DBusMessage *reply, DBusError *error)
|
|||
tmp);
|
||||
MALFORMED_MESSAGE();
|
||||
}
|
||||
options->key = xstrdup(tmp);
|
||||
options->key = strdup(tmp);
|
||||
if (!options->key) {
|
||||
ErrorF("[config/dbus] couldn't duplicate key!\n");
|
||||
ret = BadAlloc;
|
||||
|
@ -136,7 +136,7 @@ add_device(DBusMessage *message, DBusMessage *reply, DBusError *error)
|
|||
dbus_message_iter_get_basic(&subiter, &tmp);
|
||||
if (!tmp)
|
||||
MALFORMED_MESSAGE();
|
||||
options->value = xstrdup(tmp);
|
||||
options->value = strdup(tmp);
|
||||
if (!options->value) {
|
||||
ErrorF("[config/dbus] couldn't duplicate option!\n");
|
||||
ret = BadAlloc;
|
||||
|
|
14
config/hal.c
14
config/hal.c
|
@ -81,7 +81,7 @@ get_prop_string(LibHalContext *hal_ctx, const char *udi, const char *name)
|
|||
prop = libhal_device_get_property_string(hal_ctx, udi, name, NULL);
|
||||
LogMessageVerb(X_INFO, 10, "config/hal: getting %s on %s returned %s\n", name, udi, prop ? prop : "(null)");
|
||||
if (prop) {
|
||||
ret = xstrdup(prop);
|
||||
ret = strdup(prop);
|
||||
libhal_free_string(prop);
|
||||
}
|
||||
else {
|
||||
|
@ -156,13 +156,13 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
|||
LogMessage(X_WARNING,"config/hal: no driver or path specified for %s\n", udi);
|
||||
goto unwind;
|
||||
}
|
||||
attrs.device = xstrdup(path);
|
||||
attrs.device = strdup(path);
|
||||
|
||||
name = get_prop_string(hal_ctx, udi, "info.product");
|
||||
if (!name)
|
||||
name = xstrdup("(unnamed)");
|
||||
name = strdup("(unnamed)");
|
||||
else
|
||||
attrs.product = xstrdup(name);
|
||||
attrs.product = strdup(name);
|
||||
|
||||
attrs.vendor = get_prop_string(hal_ctx, udi, "info.vendor");
|
||||
hal_tags = get_prop_string(hal_ctx, udi, "input.tags");
|
||||
|
@ -211,8 +211,8 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
|||
goto unwind;
|
||||
}
|
||||
|
||||
options->key = xstrdup("_source");
|
||||
options->value = xstrdup("server/hal");
|
||||
options->key = strdup("_source");
|
||||
options->value = strdup("server/hal");
|
||||
if (!options->key || !options->value) {
|
||||
LogMessage(X_ERROR, "config/hal: couldn't allocate first key/value pair\n");
|
||||
goto unwind;
|
||||
|
@ -387,7 +387,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
|
|||
|
||||
for (; dev; dev = dev->next){
|
||||
free(dev->config_info);
|
||||
dev->config_info = xstrdup(config_info);
|
||||
dev->config_info = strdup(config_info);
|
||||
}
|
||||
|
||||
unwind:
|
||||
|
|
|
@ -86,8 +86,8 @@ device_added(struct udev_device *udev_device)
|
|||
if (!options)
|
||||
return;
|
||||
|
||||
options->key = xstrdup("_source");
|
||||
options->value = xstrdup("server/udev");
|
||||
options->key = strdup("_source");
|
||||
options->value = strdup("server/udev");
|
||||
if (!options->key || !options->value)
|
||||
goto unwind;
|
||||
|
||||
|
@ -197,7 +197,7 @@ device_added(struct udev_device *udev_device)
|
|||
|
||||
for (; dev; dev = dev->next) {
|
||||
free(dev->config_info);
|
||||
dev->config_info = xstrdup(config_info);
|
||||
dev->config_info = strdup(config_info);
|
||||
}
|
||||
|
||||
unwind:
|
||||
|
|
|
@ -1836,7 +1836,7 @@ SetDefaultFontPath(char *path)
|
|||
if (!start) {
|
||||
temp_path = Xprintf("%s%sbuilt-ins", path, *path ? "," : "");
|
||||
} else {
|
||||
temp_path = xstrdup(path);
|
||||
temp_path = strdup(path);
|
||||
}
|
||||
if (!temp_path)
|
||||
return BadAlloc;
|
||||
|
|
|
@ -127,15 +127,11 @@ exaUnrealizeGlyphCaches(ScreenPtr pScreen,
|
|||
cache->picture = NULL;
|
||||
}
|
||||
|
||||
if (cache->hashEntries) {
|
||||
free(cache->hashEntries);
|
||||
cache->hashEntries = NULL;
|
||||
}
|
||||
free(cache->hashEntries);
|
||||
cache->hashEntries = NULL;
|
||||
|
||||
if (cache->glyphs) {
|
||||
free(cache->glyphs);
|
||||
cache->glyphs = NULL;
|
||||
}
|
||||
free(cache->glyphs);
|
||||
cache->glyphs = NULL;
|
||||
cache->glyphCount = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2433,7 +2433,7 @@ int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc)
|
|||
cl->GLClientminorVersion = req->minor;
|
||||
free(cl->GLClientextensions);
|
||||
buf = (const char *)(req+1);
|
||||
cl->GLClientextensions = xstrdup(buf);
|
||||
cl->GLClientextensions = strdup(buf);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
|
@ -356,9 +356,9 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
|
|||
return;
|
||||
|
||||
pGlxScreen->pScreen = pScreen;
|
||||
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
|
||||
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
|
||||
pGlxScreen->GLXextensions = xstrdup(GLXServerExtensions);
|
||||
pGlxScreen->GLextensions = strdup(GLServerExtensions);
|
||||
pGlxScreen->GLXvendor = strdup(GLXServerVendorName);
|
||||
pGlxScreen->GLXextensions = strdup(GLXServerExtensions);
|
||||
|
||||
/* All GLX providers must support all of the functionality required for at
|
||||
* least GLX 1.2. If the provider supports a higher version, the GLXminor
|
||||
|
|
|
@ -885,7 +885,7 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
|
|||
&& dmxL->deviceId < 0) {
|
||||
dmxL->deviceId = devices[i].id;
|
||||
dmxL->deviceName = (devices[i].name
|
||||
? xstrdup(devices[i].name)
|
||||
? strdup(devices[i].name)
|
||||
: NULL);
|
||||
}
|
||||
}
|
||||
|
@ -918,7 +918,7 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
|
|||
dmxLocal->sendsCore = FALSE;
|
||||
dmxLocal->deviceId = devices[i].id;
|
||||
dmxLocal->deviceName = (devices[i].name
|
||||
? xstrdup(devices[i].name)
|
||||
? strdup(devices[i].name)
|
||||
: NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -439,6 +439,6 @@ void kbdUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
|
|||
kbdUSBGetMap(pDev, &info->keySyms, info->modMap);
|
||||
info->focusClass = 1;
|
||||
info->kbdFeedbackClass = 1;
|
||||
info->names.keycodes = xstrdup("powerpcps2");
|
||||
info->names.keycodes = strdup("powerpcps2");
|
||||
info->force = 1;
|
||||
}
|
||||
|
|
|
@ -831,10 +831,8 @@ out:
|
|||
XFreeGC (dpy, gc) ;
|
||||
gc = NULL ;
|
||||
}
|
||||
if (rects) {
|
||||
free (rects) ;
|
||||
rects = NULL ;
|
||||
}
|
||||
free(rects);
|
||||
rects = NULL;
|
||||
EPHYR_LOG ("leave\n") ;
|
||||
return is_ok ;
|
||||
}
|
||||
|
|
|
@ -669,11 +669,8 @@ hostx_screen_init (EphyrScreenInfo screen,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (host_screen->ximg->data)
|
||||
{
|
||||
free(host_screen->ximg->data);
|
||||
host_screen->ximg->data = NULL;
|
||||
}
|
||||
free(host_screen->ximg->data);
|
||||
host_screen->ximg->data = NULL;
|
||||
|
||||
XDestroyImage(host_screen->ximg);
|
||||
}
|
||||
|
@ -1160,10 +1157,8 @@ out:
|
|||
XFree (visuals) ;
|
||||
visuals = NULL;
|
||||
}
|
||||
if (host_visuals) {
|
||||
free (host_visuals) ;
|
||||
host_visuals = NULL;
|
||||
}
|
||||
free(host_visuals);
|
||||
host_visuals = NULL;
|
||||
EPHYR_LOG ("leave\n") ;
|
||||
return is_ok ;
|
||||
|
||||
|
@ -1292,10 +1287,8 @@ hostx_set_window_bounding_rectangles (int a_window,
|
|||
rects, a_num_rects, ShapeSet, YXBanded) ;
|
||||
is_ok = TRUE ;
|
||||
|
||||
if (rects) {
|
||||
free (rects) ;
|
||||
rects = NULL ;
|
||||
}
|
||||
free(rects);
|
||||
rects = NULL;
|
||||
EPHYR_LOG ("leave\n") ;
|
||||
return is_ok;
|
||||
}
|
||||
|
@ -1329,10 +1322,8 @@ hostx_set_window_clipping_rectangles (int a_window,
|
|||
rects, a_num_rects, ShapeSet, YXBanded) ;
|
||||
is_ok = TRUE ;
|
||||
|
||||
if (rects) {
|
||||
free (rects) ;
|
||||
rects = NULL ;
|
||||
}
|
||||
free(rects);
|
||||
rects = NULL;
|
||||
EPHYR_LOG ("leave\n") ;
|
||||
return is_ok;
|
||||
}
|
||||
|
|
|
@ -919,7 +919,7 @@ KdAddConfigKeyboard (char *keyboard)
|
|||
if (!new)
|
||||
return BadAlloc;
|
||||
|
||||
new->line = xstrdup(keyboard);
|
||||
new->line = strdup(keyboard);
|
||||
new->next = NULL;
|
||||
|
||||
for (prev = &kdConfigKeyboards; *prev; prev = &(*prev)->next);
|
||||
|
@ -987,7 +987,7 @@ KdAddConfigPointer (char *pointer)
|
|||
if (!new)
|
||||
return BadAlloc;
|
||||
|
||||
new->line = xstrdup(pointer);
|
||||
new->line = strdup(pointer);
|
||||
new->next = NULL;
|
||||
|
||||
for (prev = &kdConfigPointers; *prev; prev = &(*prev)->next);
|
||||
|
@ -1067,11 +1067,11 @@ KdGetOptions (InputOption **options, char *string)
|
|||
newopt->key = (char *)malloc(tam_key);
|
||||
strncpy(newopt->key, string, tam_key);
|
||||
newopt->key[tam_key] = '\0';
|
||||
newopt->value = xstrdup(strchr(string, '=') + 1);
|
||||
newopt->value = strdup(strchr(string, '=') + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
newopt->key = xstrdup(string);
|
||||
newopt->key = strdup(string);
|
||||
newopt->value = NULL;
|
||||
}
|
||||
newopt->next = NULL;
|
||||
|
@ -1147,7 +1147,7 @@ KdParseKeyboard (char *arg)
|
|||
if (strcmp (save, "auto") == 0)
|
||||
ki->driverPrivate = NULL;
|
||||
else
|
||||
ki->driverPrivate = xstrdup(save);
|
||||
ki->driverPrivate = strdup(save);
|
||||
|
||||
if (delim != ',')
|
||||
{
|
||||
|
@ -1243,7 +1243,7 @@ KdParsePointer (char *arg)
|
|||
if (strcmp(save, "auto") == 0)
|
||||
pi->driverPrivate = NULL;
|
||||
else
|
||||
pi->driverPrivate = xstrdup(save);
|
||||
pi->driverPrivate = strdup(save);
|
||||
|
||||
if (delim != ',')
|
||||
{
|
||||
|
|
|
@ -277,16 +277,16 @@ configureInputSection (void)
|
|||
mouse->inp_identifier = "Mouse0";
|
||||
mouse->inp_driver = "mouse";
|
||||
mouse->inp_option_lst =
|
||||
xf86addNewOption(mouse->inp_option_lst, xstrdup("Protocol"),
|
||||
xstrdup(DFLT_MOUSE_PROTO));
|
||||
xf86addNewOption(mouse->inp_option_lst, strdup("Protocol"),
|
||||
strdup(DFLT_MOUSE_PROTO));
|
||||
#ifndef __SCO__
|
||||
mouse->inp_option_lst =
|
||||
xf86addNewOption(mouse->inp_option_lst, xstrdup("Device"),
|
||||
xstrdup(DFLT_MOUSE_DEV));
|
||||
xf86addNewOption(mouse->inp_option_lst, strdup("Device"),
|
||||
strdup(DFLT_MOUSE_DEV));
|
||||
#endif
|
||||
mouse->inp_option_lst =
|
||||
xf86addNewOption(mouse->inp_option_lst, xstrdup("ZAxisMapping"),
|
||||
xstrdup("4 5 6 7"));
|
||||
xf86addNewOption(mouse->inp_option_lst, strdup("ZAxisMapping"),
|
||||
strdup("4 5 6 7"));
|
||||
ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse);
|
||||
return ptr;
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ configureDeviceSection (int screennum)
|
|||
" ### <string>: \"String\", <freq>: \"<f> Hz/kHz/MHz\",\n"
|
||||
" ### <percent>: \"<f>%\"\n"
|
||||
" ### [arg]: arg optional\n";
|
||||
ptr->dev_comment = xstrdup(descrip);
|
||||
ptr->dev_comment = strdup(descrip);
|
||||
if (ptr->dev_comment) {
|
||||
for (p = DevToConfig[screennum].GDev.options;
|
||||
p->name != NULL; p++) {
|
||||
|
@ -440,7 +440,7 @@ configureLayoutSection (void)
|
|||
iptr->iref_option_lst = NULL;
|
||||
iptr->iref_inputdev_str = "Mouse0";
|
||||
iptr->iref_option_lst =
|
||||
xf86addNewOption (iptr->iref_option_lst, xstrdup("CorePointer"), NULL);
|
||||
xf86addNewOption (iptr->iref_option_lst, strdup("CorePointer"), NULL);
|
||||
ptr->lay_input_lst = (XF86ConfInputrefPtr)
|
||||
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ configureLayoutSection (void)
|
|||
iptr->iref_option_lst = NULL;
|
||||
iptr->iref_inputdev_str = "Keyboard0";
|
||||
iptr->iref_option_lst =
|
||||
xf86addNewOption (iptr->iref_option_lst, xstrdup("CoreKeyboard"), NULL);
|
||||
xf86addNewOption (iptr->iref_option_lst, strdup("CoreKeyboard"), NULL);
|
||||
ptr->lay_input_lst = (XF86ConfInputrefPtr)
|
||||
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
|
||||
}
|
||||
|
@ -626,7 +626,7 @@ configureDDCMonitorSection (int screennum)
|
|||
ptr);
|
||||
|
||||
if (ConfiguredMonitor->features.dpms) {
|
||||
ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, xstrdup("DPMS"), NULL);
|
||||
ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, strdup("DPMS"), NULL);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
|
|
|
@ -209,7 +209,7 @@ LookupStrOption(pointer optlist, const char *name, char *deflt, Bool markUsed)
|
|||
if (ParseOptionValue(-1, optlist, &o, markUsed))
|
||||
deflt = o.value.str;
|
||||
if (deflt)
|
||||
return xstrdup(deflt);
|
||||
return strdup(deflt);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ InitPathList(const char *path)
|
|||
if (!path)
|
||||
return defaultPathList;
|
||||
|
||||
fullpath = xstrdup(path);
|
||||
fullpath = strdup(path);
|
||||
if (!fullpath)
|
||||
return NULL;
|
||||
elem = strtok(fullpath, ",");
|
||||
|
@ -353,7 +353,7 @@ InitSubdirs(const char **subdirlist)
|
|||
sprintf(subdirs[i], "%s%s%s/", *s, slash, osname);
|
||||
i++;
|
||||
/* path as given */
|
||||
subdirs[i] = xstrdup(*s);
|
||||
subdirs[i] = strdup(*s);
|
||||
i++;
|
||||
s++;
|
||||
if (indefault && !s) {
|
||||
|
@ -1246,7 +1246,7 @@ LoaderGetCanonicalName(const char *modname, PatternPtr patterns)
|
|||
}
|
||||
|
||||
/* If there is no match, return the whole name minus the leading path */
|
||||
return xstrdup(s);
|
||||
return strdup(s);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -659,11 +659,8 @@ xf86_cursors_fini (ScreenPtr screen)
|
|||
xf86DestroyCursorInfoRec (xf86_config->cursor_info);
|
||||
xf86_config->cursor_info = NULL;
|
||||
}
|
||||
if (xf86_config->cursor_image)
|
||||
{
|
||||
free(xf86_config->cursor_image);
|
||||
xf86_config->cursor_image = NULL;
|
||||
}
|
||||
free(xf86_config->cursor_image);
|
||||
xf86_config->cursor_image = NULL;
|
||||
if (xf86_config->cursor)
|
||||
{
|
||||
FreeCursor (xf86_config->cursor, None);
|
||||
|
|
|
@ -191,10 +191,8 @@ sparcPromClose(void)
|
|||
close(promFd);
|
||||
promFd = -1;
|
||||
}
|
||||
if (promOpio) {
|
||||
free(promOpio);
|
||||
promOpio = NULL;
|
||||
}
|
||||
free(promOpio);
|
||||
promOpio = NULL;
|
||||
promOpenCount = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -595,12 +595,12 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
|
|||
|
||||
__glXScreenInit(&screen->base, pScreen);
|
||||
|
||||
screen->base.GLXversion = xstrdup("1.4");
|
||||
screen->base.GLXextensions = xstrdup("GLX_SGIX_fbconfig "
|
||||
"GLX_SGIS_multisample "
|
||||
"GLX_ARB_multisample "
|
||||
"GLX_EXT_visual_info "
|
||||
"GLX_EXT_import_context ");
|
||||
screen->base.GLXversion = strdup("1.4");
|
||||
screen->base.GLXextensions = strdup("GLX_SGIX_fbconfig "
|
||||
"GLX_SGIS_multisample "
|
||||
"GLX_ARB_multisample "
|
||||
"GLX_EXT_visual_info "
|
||||
"GLX_EXT_import_context ");
|
||||
|
||||
/*We may be able to add more GLXextensions at a later time. */
|
||||
|
||||
|
|
|
@ -275,11 +275,8 @@ ddxGiveUp (void)
|
|||
}
|
||||
|
||||
/* Free concatenated command line */
|
||||
if (g_pszCommandLine)
|
||||
{
|
||||
free (g_pszCommandLine);
|
||||
g_pszCommandLine = NULL;
|
||||
}
|
||||
free(g_pszCommandLine);
|
||||
g_pszCommandLine = NULL;
|
||||
|
||||
/* Remove our keyboard hook if it is installed */
|
||||
winRemoveKeyboardHookLL ();
|
||||
|
@ -441,7 +438,7 @@ winFixupPaths (void)
|
|||
int comment_block = FALSE;
|
||||
|
||||
/* get defautl fontpath */
|
||||
char *fontpath = xstrdup(defaultFontPath);
|
||||
char *fontpath = strdup(defaultFontPath);
|
||||
size_t size = strlen(fontpath);
|
||||
|
||||
/* read all lines */
|
||||
|
@ -528,7 +525,7 @@ winFixupPaths (void)
|
|||
|
||||
/* cleanup */
|
||||
fclose(fontdirs);
|
||||
defaultFontPath = xstrdup(fontpath);
|
||||
defaultFontPath = strdup(fontpath);
|
||||
free(fontpath);
|
||||
changed_fontpath = TRUE;
|
||||
font_from = X_CONFIG;
|
||||
|
@ -600,7 +597,7 @@ winFixupPaths (void)
|
|||
}
|
||||
}
|
||||
|
||||
defaultFontPath = xstrdup(newfp);
|
||||
defaultFontPath = strdup(newfp);
|
||||
free(newfp);
|
||||
changed_fontpath = TRUE;
|
||||
}
|
||||
|
|
|
@ -676,7 +676,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
|
|||
fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
|
||||
|
||||
// Override the GL extensions string set by __glXScreenInit()
|
||||
screen->base.GLextensions = xstrdup(gl_extensions);
|
||||
screen->base.GLextensions = strdup(gl_extensions);
|
||||
|
||||
// Generate the GLX extensions string (overrides that set by __glXScreenInit())
|
||||
{
|
||||
|
@ -706,13 +706,13 @@ glxWinScreenProbe(ScreenPtr pScreen)
|
|||
|
||||
if (screen->has_WGL_ARB_multisample)
|
||||
{
|
||||
screen->base.GLXversion = xstrdup("1.4");
|
||||
screen->base.GLXversion = strdup("1.4");
|
||||
screen->base.GLXmajor = 1;
|
||||
screen->base.GLXminor = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
screen->base.GLXversion = xstrdup("1.3");
|
||||
screen->base.GLXversion = strdup("1.3");
|
||||
screen->base.GLXmajor = 1;
|
||||
screen->base.GLXminor = 3;
|
||||
}
|
||||
|
|
|
@ -583,7 +583,7 @@ winConfigFiles ()
|
|||
else if (filesptr != NULL && filesptr->file_fontpath)
|
||||
{
|
||||
from = X_CONFIG;
|
||||
defaultFontPath = xstrdup (filesptr->file_fontpath);
|
||||
defaultFontPath = strdup (filesptr->file_fontpath);
|
||||
}
|
||||
winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath);
|
||||
|
||||
|
@ -630,7 +630,7 @@ winSetStrOption (pointer optlist, const char *name, char *deflt)
|
|||
if (ParseOptionValue (-1, optlist, &o))
|
||||
deflt = o.value.str;
|
||||
if (deflt)
|
||||
return xstrdup (deflt);
|
||||
return strdup (deflt);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -2520,8 +2520,6 @@ RecordDeleteContext(pointer value, XID id)
|
|||
}
|
||||
}
|
||||
|
||||
free(pContext);
|
||||
|
||||
/* remove context from AllContexts list */
|
||||
|
||||
if (-1 != (i = RecordFindContextOnAllContexts(pContext)))
|
||||
|
@ -2533,6 +2531,8 @@ RecordDeleteContext(pointer value, XID id)
|
|||
ppAllContexts = NULL;
|
||||
}
|
||||
}
|
||||
free(pContext);
|
||||
|
||||
return Success;
|
||||
} /* RecordDeleteContext */
|
||||
|
||||
|
|
|
@ -114,10 +114,8 @@ register char *ptr;
|
|||
}
|
||||
if (freeAll) {
|
||||
(*num_inout)= (*sz_inout)= 0;
|
||||
if (*elems) {
|
||||
free(*elems);
|
||||
*elems= NULL;
|
||||
}
|
||||
free(*elems);
|
||||
*elems = NULL;
|
||||
}
|
||||
else if (first+count>=(*num_inout))
|
||||
*num_inout= first;
|
||||
|
@ -137,14 +135,10 @@ _XkbClearProperty(char *prop_in)
|
|||
{
|
||||
XkbPropertyPtr prop= (XkbPropertyPtr)prop_in;
|
||||
|
||||
if (prop->name) {
|
||||
free(prop->name);
|
||||
prop->name= NULL;
|
||||
}
|
||||
if (prop->value) {
|
||||
free(prop->value);
|
||||
prop->value= NULL;
|
||||
}
|
||||
free(prop->name);
|
||||
prop->name = NULL;
|
||||
free(prop->value);
|
||||
prop->value = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -221,18 +221,12 @@ XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into)
|
|||
{
|
||||
if ((!from)||(!into))
|
||||
return BadMatch;
|
||||
if (into->map) {
|
||||
free(into->map);
|
||||
into->map= NULL;
|
||||
}
|
||||
if (into->preserve) {
|
||||
free(into->preserve);
|
||||
into->preserve= NULL;
|
||||
}
|
||||
if (into->level_names) {
|
||||
free(into->level_names);
|
||||
into->level_names= NULL;
|
||||
}
|
||||
free(into->map);
|
||||
into->map = NULL;
|
||||
free(into->preserve);
|
||||
into->preserve = NULL;
|
||||
free(into->level_names);
|
||||
into->level_names = NULL;
|
||||
*into= *from;
|
||||
if ((from->map)&&(into->map_count>0)) {
|
||||
into->map= calloc(into->map_count, sizeof(XkbKTMapEntryRec));
|
||||
|
|
|
@ -208,10 +208,7 @@ char tmpname[PATH_MAX];
|
|||
return BadImplementation;
|
||||
}
|
||||
list->nFound[what]= 0;
|
||||
if (buf) {
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
free(buf);
|
||||
buf = malloc(PATH_MAX * sizeof(char));
|
||||
if (!buf)
|
||||
return BadAlloc;
|
||||
|
|
|
@ -103,7 +103,7 @@ Win32System(const char *cmdline)
|
|||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
DWORD dwExitCode;
|
||||
char *cmd = xstrdup(cmdline);
|
||||
char *cmd = strdup(cmdline);
|
||||
|
||||
ZeroMemory( &si, sizeof(si) );
|
||||
si.cb = sizeof(si);
|
||||
|
@ -235,6 +235,11 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
|
|||
xkm_output_dir, keymap);
|
||||
|
||||
free(xkbbasedirflag);
|
||||
|
||||
if (!buf) {
|
||||
LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
out= Popen(buf,"w");
|
||||
|
|
21
xkb/xkb.c
21
xkb/xkb.c
|
@ -5510,10 +5510,8 @@ ProcXkbListComponents(ClientPtr client)
|
|||
if ((XkbPaddedSize(len)/4)!=stuff->length)
|
||||
return BadLength;
|
||||
if ((status=XkbDDXList(dev,&list,client))!=Success) {
|
||||
if (list.pool) {
|
||||
free(list.pool);
|
||||
list.pool= NULL;
|
||||
}
|
||||
free(list.pool);
|
||||
list.pool = NULL;
|
||||
return status;
|
||||
}
|
||||
memset(&rep, 0, sizeof(xkbListComponentsReply));
|
||||
|
@ -5886,11 +5884,16 @@ ProcXkbGetKbdByName(ClientPtr client)
|
|||
XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE);
|
||||
new= NULL;
|
||||
}
|
||||
if (names.keycodes) { free(names.keycodes); names.keycodes= NULL; }
|
||||
if (names.types) { free(names.types); names.types= NULL; }
|
||||
if (names.compat) { free(names.compat); names.compat= NULL; }
|
||||
if (names.symbols) { free(names.symbols); names.symbols= NULL; }
|
||||
if (names.geometry) { free(names.geometry); names.geometry= NULL; }
|
||||
free(names.keycodes);
|
||||
names.keycodes = NULL;
|
||||
free(names.types);
|
||||
names.types = NULL;
|
||||
free(names.compat);
|
||||
names.compat = NULL;
|
||||
free(names.symbols);
|
||||
names.symbols = NULL;
|
||||
free(names.geometry);
|
||||
names.geometry = NULL;
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
@ -635,10 +635,8 @@ unwind_key:
|
|||
void
|
||||
XkbFreeInfo(XkbSrvInfoPtr xkbi)
|
||||
{
|
||||
if (xkbi->radioGroups) {
|
||||
free(xkbi->radioGroups);
|
||||
xkbi->radioGroups= NULL;
|
||||
}
|
||||
free(xkbi->radioGroups);
|
||||
xkbi->radioGroups = NULL;
|
||||
if (xkbi->mouseKeyTimer) {
|
||||
TimerFree(xkbi->mouseKeyTimer);
|
||||
xkbi->mouseKeyTimer= NULL;
|
||||
|
|
|
@ -1761,15 +1761,15 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst)
|
|||
if (sdoodad->any.type == XkbTextDoodad) {
|
||||
if (sdoodad->text.text)
|
||||
ddoodad->text.text =
|
||||
xstrdup(sdoodad->text.text);
|
||||
strdup(sdoodad->text.text);
|
||||
if (sdoodad->text.font)
|
||||
ddoodad->text.font =
|
||||
xstrdup(sdoodad->text.font);
|
||||
strdup(sdoodad->text.font);
|
||||
}
|
||||
else if (sdoodad->any.type == XkbLogoDoodad) {
|
||||
if (sdoodad->logo.logo_name)
|
||||
ddoodad->logo.logo_name =
|
||||
xstrdup(sdoodad->logo.logo_name);
|
||||
strdup(sdoodad->logo.logo_name);
|
||||
}
|
||||
}
|
||||
dsection->overlays = NULL;
|
||||
|
@ -1832,14 +1832,14 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst)
|
|||
memcpy(ddoodad , sdoodad, sizeof(XkbDoodadRec));
|
||||
if (sdoodad->any.type == XkbTextDoodad) {
|
||||
if (sdoodad->text.text)
|
||||
ddoodad->text.text = xstrdup(sdoodad->text.text);
|
||||
ddoodad->text.text = strdup(sdoodad->text.text);
|
||||
if (sdoodad->text.font)
|
||||
ddoodad->text.font = xstrdup(sdoodad->text.font);
|
||||
ddoodad->text.font = strdup(sdoodad->text.font);
|
||||
}
|
||||
else if (sdoodad->any.type == XkbLogoDoodad) {
|
||||
if (sdoodad->logo.logo_name)
|
||||
ddoodad->logo.logo_name =
|
||||
xstrdup(sdoodad->logo.logo_name);
|
||||
strdup(sdoodad->logo.logo_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue