if (!lenfname)
if (!lenfname || lenfname > XLFDMAXFONTNAMELEN)
OpenFont(client, fid, flags, lenfname, pfontname)    ClientPtr   client;    XID         fid;    Mask        flags;    unsigned    lenfname;    char       *pfontname;{    OFclosurePtr c;    int         i;    FontPtr     cached = (FontPtr)0;#ifdef FONTDEBUG    char *f;    f = (char *)xalloc(lenfname + 1);    memmove(f, pfontname, lenfname);    f[lenfname] = '\0';    ErrorF("OpenFont: fontname is \"%s\"\n", f);    xfree(f);#endif    if (!lenfname)	return BadName;    if (patternCache)    {    /*    ** Check name cache.  If we find a cached version of this font that    ** is cachable, immediately satisfy the request with it.  If we find    ** a cached version of this font that is non-cachable, we do not    ** satisfy the request with it.  Instead, we pass the FontPtr to the    ** FPE's open_font code (the fontfile FPE in turn passes the    ** information to the rasterizer; the fserve FPE ignores it).    **    ** Presumably, the font is marked non-cachable because the FPE has    ** put some licensing restrictions on it.  If the FPE, using    ** whatever logic it relies on, determines that it is willing to    ** share this existing font with the client, then it has the option    ** to return the FontPtr we passed it as the newly-opened font.    ** This allows the FPE to exercise its licensing logic without    ** having to create another instance of a font that already exists.    */	cached = FindCachedFontPattern(patternCache, pfontname, lenfname);	if (cached && cached->info.cachable)	{	    if (!AddResource(fid, RT_FONT, (pointer) cached))		return BadAlloc;	    cached->refcnt++;	    return Success;	}    }    c = (OFclosurePtr) xalloc(sizeof(OFclosureRec));    if (!c)	return BadAlloc;    c->fontname = (char *) xalloc(lenfname);    c->origFontName = pfontname;    c->origFontNameLen = lenfname;    if (!c->fontname) {	xfree(c);	return BadAlloc;    }    /*     * copy the current FPE list, so that if it gets changed by another client     * while we're blocking, the request still appears atomic     */    c->fpe_list = (FontPathElementPtr *)	xalloc(sizeof(FontPathElementPtr) * num_fpes);    if (!c->fpe_list) {	xfree(c->fontname);	xfree(c);	return BadAlloc;    }    memmove(c->fontname, pfontname, lenfname);    for (i = 0; i < num_fpes; i++) {	c->fpe_list[i] = font_path_elements[i];	UseFPE(c->fpe_list[i]);    }    c->client = client;    c->fontid = fid;    c->current_fpe = 0;    c->num_fpes = num_fpes;    c->fnamelen = lenfname;    c->slept = FALSE;    c->flags = flags;    c->non_cachable_font = cached;    (void) doOpenFont(client, c);    return Success;}