Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
plug memleak in find_window
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
73e3fc7
..
1751412
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-2299,8
+2299,10
@@
find_window(xcb_window_t id)
return (NULL);
/* if we were looking for the parent return that window instead */
return (NULL);
/* if we were looking for the parent return that window instead */
- if (r->parent == 0 || r->root == r->parent)
+ if (r->parent == 0 || r->root == r->parent) {
+ free(r);
return (NULL);
return (NULL);
+ }
/* look for parent */
for (i = 0; i < num_screens; i++)
/* look for parent */
for (i = 0; i < num_screens; i++)
@@
-3730,12
+3732,10
@@
get_win_name(xcb_window_t win)
if (xcb_icccm_get_wm_name_reply(conn, c, &r, NULL)) {
if (r.name_len > 0) {
name = malloc(r.name_len + 1);
if (xcb_icccm_get_wm_name_reply(conn, c, &r, NULL)) {
if (r.name_len > 0) {
name = malloc(r.name_len + 1);
- if (!name) {
- xcb_icccm_get_text_property_reply_wipe(&r);
- return (NULL);
+ if (name) {
+ memcpy(name, r.name, r.name_len);
+ name[r.name_len] = '\0';
}
}
- memcpy(name, r.name, r.name_len);
- name[r.name_len] = '\0';
}
xcb_icccm_get_text_property_reply_wipe(&r);
}
}
xcb_icccm_get_text_property_reply_wipe(&r);
}