projects
/
sent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
243c8cf
)
drw.c: Avoid potential memory leak in drw_cur_create()
author
Quentin Rameau
<quinq+hackers@fifth.space>
Wed, 18 Nov 2015 21:45:26 +0000
(22:45 +0100)
committer
Markus Teich
<markus.teich@stusta.mhn.de>
Wed, 18 Nov 2015 21:50:07 +0000
(22:50 +0100)
If drw was NULL, memory was still allocated for cur.
drw.c
patch
|
blob
|
history
diff --git
a/drw.c
b/drw.c
index a2dfe6c601067d42b29d9803473a5167641f65a2..15797ceb67ae85edf6140eb7f60dae9f395c90c2 100644
(file)
--- a/
drw.c
+++ b/
drw.c
@@
-396,9
+396,9
@@
drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w,
Cur *
drw_cur_create(Drw *drw, int shape) {
- Cur *cur
= (Cur *)calloc(1, sizeof(Cur))
;
+ Cur *cur;
- if(!drw || !
cur
)
+ if(!drw || !
(cur = (Cur *)calloc(1, sizeof(Cur)))
)
return NULL;
cur->cursor = XCreateFontCursor(drw->dpy, shape);
return cur;