Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
ced973e3
Unverified
Commit
ced973e3
authored
Nov 03, 2020
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/font_memleak' into 3.6.x
Attributes GH PR #949:
https://github.com/ArcticaProject/nx-libs/pull/949
parents
14df32cd
db45683a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
6 deletions
+56
-6
NXdixfonts.c
nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
+56
-6
No files found.
nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
View file @
ced973e3
...
...
@@ -924,6 +924,9 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
ContBadFontName:
;
c
->
current
.
list_started
=
FALSE
;
c
->
current
.
current_fpe
++
;
#ifdef NXAGENT_SERVER
c
->
current
.
private
=
0
;
/* BadFontName -> private has been freed */
#endif
err
=
Successful
;
if
(
c
->
haveSaved
)
{
...
...
@@ -1070,6 +1073,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss)
int
i
;
int
aliascount
=
0
;
char
tmp
[
256
];
tmp
[
0
]
=
0
;
if
(
client
->
clientGone
)
{
...
...
@@ -1195,6 +1199,13 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss)
if
(
err
==
Successful
)
{
#ifndef BREAK_XFONT_LOOP
if
(
tmp
[
0
]
!=
0
)
{
continue
;
}
#endif
if
(
c
->
haveSaved
)
{
if
(
c
->
savedName
)
...
...
@@ -1202,8 +1213,14 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss)
memcpy
(
tmp
,
c
->
savedName
,
c
->
savedNameLen
>
255
?
255
:
c
->
savedNameLen
);
tmp
[
c
->
savedNameLen
>
255
?
255
:
c
->
savedNameLen
]
=
0
;
if
(
nxagentFontLookUp
(
tmp
))
break
;
else
tmp
[
0
]
=
0
;
{
#ifdef BREAK_XFONT_LOOP
break
;
#else
continue
;
#endif
}
else
tmp
[
0
]
=
0
;
}
}
else
...
...
@@ -1211,7 +1228,13 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss)
memcpy
(
tmp
,
name
,
namelen
>
255
?
255
:
namelen
);
tmp
[
namelen
>
255
?
255
:
namelen
]
=
0
;
if
(
nxagentFontLookUp
(
tmp
))
break
;
{
#ifdef BREAK_XFONT_LOOP
break
;
#else
continue
;
#endif
}
else
tmp
[
0
]
=
0
;
}
}
...
...
@@ -1282,6 +1305,10 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss)
ContBadFontName:
;
c
->
current
.
list_started
=
FALSE
;
c
->
current
.
current_fpe
++
;
#ifdef NXAGENT_SERVER
/* clearing a freed pointer helps for debugging */
c
->
current
.
private
=
0
;
/* BadFontName means private has been freed */
#endif
err
=
Successful
;
if
(
c
->
haveSaved
)
{
...
...
@@ -1298,11 +1325,34 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss)
}
}
/*
* send the reply
*/
bail:
finish:
#ifdef BREAK_XFONT_LOOP
/* if we allow above loop to be exited via break
we need to free the private xfont data somehow. */
if
(
c
->
current
.
list_started
)
{
/* WARNING: this codes makes assumptions about an internal
private structure of libXfont and can therefore break with
ANY libXfont update! */
typedef
struct
_LFWIData
{
FontNamesPtr
names
;
int
current
;
}
LFWIDataRec
,
*
LFWIDataPtr
;
LFWIDataPtr
data
=
c
->
current
.
private
;
if
(
data
)
{
#ifdef HAS_XFONT2
xfont2_free_font_names
(
data
->
names
);
#else
FreeFontName
(
data
->
names
);
#endif
free
(
data
);
}
}
#endif
if
(
strlen
(
tmp
))
{
#ifdef NXAGENT_FONTMATCH_DEBUG
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment