xserver/dix dixfonts.c,3.32,3.33
Keith Packard <xserver-commit-u7BhqnqprCWvj1b/[email protected]> Mon, 15 Aug 2005 22:20:32 -0700 (PDT)
| Newsgroups | gmane.comp.freedesktop.xserver.cvs |
|---|---|
| Message-ID | <[email protected]> |
Committed by: keithp Update of /cvs/xserver/xserver/dix In directory gabe:/tmp/cvs-serv29112/dix Modified Files: dixfonts.c Log Message: 2005-08-15 Keith Packard <[email protected]> * dix/dixfonts.c: X.org Xfont changed the API (in a good way) for the list_next_font_with_info function. I think this patch will actually work with the xlibs version, but I haven't tested it. Index: dixfonts.c =================================================================== RCS file: /cvs/xserver/xserver/dix/dixfonts.c,v retrieving revision 3.32 retrieving revision 3.33 diff -u -d -r3.32 -r3.33 --- dixfonts.c 18 Feb 2004 03:23:36 -0000 3.32 +++ dixfonts.c 16 Aug 2005 05:20:30 -0000 3.33 @@ -979,7 +979,11 @@ c->saved = c->current; c->haveSaved = TRUE; c->savedNumFonts = numFonts; - c->savedName = (char *) pFontInfo; + if (c->savedName) + xfree(c->savedName); + c->savedName = (char *)xalloc(namelen + 1); + if (c->savedName) + memmove(c->savedName, name, namelen + 1); aliascount = 20; } memmove(c->current.pattern, name, namelen); @@ -1086,6 +1090,7 @@ FreeFPE(c->fpe_list[i]); xfree(c->reply); xfree(c->fpe_list); + if (c->savedName) xfree(c->savedName); xfree(c); return TRUE; } @@ -1136,6 +1141,7 @@ c->savedNumFonts = 0; c->haveSaved = FALSE; c->slept = FALSE; + c->savedName = 0; doListFontsWithInfo(client, c); return Success; badAlloc: