Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfwm4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xfce
xfwm4
Commits
1bee951a
Commit
1bee951a
authored
22 years ago
by
Olivier Fourdan
Browse files
Options
Downloads
Patches
Plain Diff
Fix memory leak in key parsing as spotted by Thomas Leonard <tal00r@ecs.soton.ac.uk>
(Old svn revision: 10655)
parent
3915d8cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/keyboard.c
+18
-6
18 additions, 6 deletions
src/keyboard.c
with
18 additions
and
6 deletions
src/keyboard.c
+
18
−
6
View file @
1bee951a
...
...
@@ -30,8 +30,6 @@
#include
"keyboard.h"
#include
"debug.h"
#define PARSEKEY(s, k) strstr(g_ascii_strdown (s, strlen (s)), g_ascii_strdown(k, strlen (k)))
unsigned
int
KeyMask
;
unsigned
int
ButtonMask
;
unsigned
int
ButtonKeyMask
;
...
...
@@ -59,15 +57,29 @@ void parseKeyString(Display * dpy, MyKey * key, char *str)
k
=
strrchr
(
str
,
'+'
);
if
(
k
)
{
gchar
*
tmp
;
tmp
=
g_ascii_strdown
(
str
,
-
1
);
key
->
keycode
=
XKeysymToKeycode
(
dpy
,
XStringToKeysym
(
k
+
1
));
if
(
PARSEKEY
(
str
,
"Shift"
))
if
(
strstr
(
str
,
"shift"
))
{
key
->
modifier
=
key
->
modifier
|
ShiftMask
;
if
(
PARSEKEY
(
str
,
"Control"
))
}
if
(
strstr
(
str
,
"control"
))
{
key
->
modifier
=
key
->
modifier
|
ControlMask
;
if
(
PARSEKEY
(
str
,
"Alt"
)
||
PARSEKEY
(
str
,
"Mod1"
))
}
if
(
strstr
(
str
,
"alt"
)
||
strstr
(
str
,
"mod1"
))
{
key
->
modifier
=
key
->
modifier
|
AltMask
;
if
(
PARSEKEY
(
str
,
"Meta"
)
||
PARSEKEY
(
str
,
"Mod2"
))
}
if
(
strstr
(
str
,
"meta"
)
||
strstr
(
str
,
"mod2"
))
{
key
->
modifier
=
key
->
modifier
|
MetaMask
;
}
g_free
(
tmp
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment