[PATCH 3/5] Do not jump through the hoops to deallocate xkbbasedirflag variable

Jamey Sharp jamey at minilop.net
Wed May 12 14:04:13 PDT 2010


On Wed, May 12, 2010 at 1:33 PM, Mikhail Gusarov
<dottedmag at dottedmag.net> wrote:
> --- a/xkb/ddxLoad.c
> +++ b/xkb/ddxLoad.c
> @@ -185,8 +185,8 @@ XkbDDXCompileKeymapByNames( XkbDescPtr              xkb,
>     FILE *     out;
>     char       *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX];
>
> -    const char *emptystring = "";
> -    const char *xkbbasedirflag = emptystring;
> +    char *emptystring = "";
> +    char *xkbbasedirflag = NULL;
>     const char *xkbbindir = emptystring;
>     const char *xkbbindirsep = emptystring;

It looks like you didn't need to change the declaration of
emptystring. I'd vote for keeping that const, since string literals
really aren't writable.

Otherwise, it looks great:
Reviewed-by: Jamey Sharp <jamey at minilop.net>

Jamey


More information about the xorg-devel mailing list