[PATCH xserver] config: Support multiple 'Files' sections

Keith Packard keithp at keithp.com
Mon Mar 9 12:39:31 PDT 2015


Michał Górny <mgorny at gentoo.org> writes:

> Does it? Well, I didn't put much effort into that since the existing
> code was just dumb enough to allocate-and-replace the struct when
> defined multiple times.

These two pieces will drop memory on the floor if invoked twice. Just
calling free before the assignment should be fine as the struct is
calloc'd. 

        case LOGFILEPATH:
            if (xf86getSubToken(&(ptr->file_comment)) != STRING)
                Error(QUOTE_MSG, "LogFile");
            ptr->file_logfile = xf86_lex_val.str;
            break;
        case XKBDIR:
            if (xf86getSubToken(&(ptr->file_xkbdir)) != STRING)

This should be file_comment, not file_xkbdir.

                Error(QUOTE_MSG, "XkbDir");
            ptr->file_xkbdir = xf86_lex_val.str;
            break;

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150309/7997289a/attachment.sig>


More information about the xorg-devel mailing list