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 memory leak in get_atom_name
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
e5a8a02
..
a4cad40
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-6464,6
+6464,7
@@
get_ws_idx(xcb_window_t id)
DNPRINTF(SWM_D_PROP, "get_ws_idx: window: #%s: %s",
errstr, prop);
}
DNPRINTF(SWM_D_PROP, "get_ws_idx: window: #%s: %s",
errstr, prop);
}
+ free(prop);
}
return ws_idx;
}
return ws_idx;
@@
-7115,7
+7116,7
@@
maprequest(xcb_map_request_event_t *e)
char *
get_atom_name(xcb_atom_t atom)
{
char *
get_atom_name(xcb_atom_t atom)
{
- char *name;
+ char *name = NULL;
size_t len;
xcb_get_atom_name_reply_t *r;
size_t len;
xcb_get_atom_name_reply_t *r;
@@
-7129,14
+7130,12
@@
get_atom_name(xcb_atom_t atom)
if (name) {
memcpy(name, xcb_get_atom_name_name(r), len);
name[len] = '\0';
if (name) {
memcpy(name, xcb_get_atom_name_name(r), len);
name[len] = '\0';
-
- return name;
}
}
free(r);
}
}
}
free(r);
}
- return NULL;
+ return (name);
}
#endif
}
#endif