Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c646259
)
plug some memory leaks.
author
David Hill
<dhill@conformal.com>
Wed, 29 Aug 2012 15:35:40 +0000
(11:35 -0400)
committer
David Hill
<dhill@conformal.com>
Wed, 29 Aug 2012 15:35:40 +0000
(11:35 -0400)
spectrwm.c
patch
|
blob
|
history
diff --git
a/spectrwm.c
b/spectrwm.c
index
75aec9c
..
ff3dfbd
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-2802,6
+2802,7
@@
get_pointer_win(xcb_window_t root)
} else {
DNPRINTF(SWM_D_EVENT, "get_pointer_win: none.\n");
}
} else {
DNPRINTF(SWM_D_EVENT, "get_pointer_win: none.\n");
}
+ free(r);
}
return win;
}
return win;
@@
-4488,24
+4489,28
@@
get_win_name(xcb_window_t win)
XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
r = xcb_get_property_reply(conn, c, NULL);
XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
r = xcb_get_property_reply(conn, c, NULL);
- if (!r || r->type == XCB_NONE) {
- free(r);
- /* Use WM_NAME instead; no UTF-8. */
- c = xcb_get_property(conn, 0, win, XCB_ATOM_WM_NAME,
- XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
- r = xcb_get_property_reply(conn, c, NULL);
-
- if(!r || r->type == XCB_NONE) {
+ if (r) {
+ if (r->type == XCB_NONE) {
free(r);
free(r);
- return NULL;
+ /* Use WM_NAME instead; no UTF-8. */
+ c = xcb_get_property(conn, 0, win, XCB_ATOM_WM_NAME,
+ XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
+ r = xcb_get_property_reply(conn, c, NULL);
+
+ if (!r)
+ return (NULL);
+ if (r->type == XCB_NONE) {
+ free(r);
+ return (NULL);
+ }
}
}
- }
+ if (r->length > 0)
+ name = strndup(xcb_get_property_value(r),
+ xcb_get_property_value_length(r));
- if (r->length > 0)
- name = strndup(xcb_get_property_value(r),
- xcb_get_property_value_length(r));
+ free(r);
+ }
- free(r);
return (name);
}
return (name);
}