mirror of https://github.com/yshui/picom.git
Fix several memory leaks
* src/event.c: expose_root: region is not freed * backend/xrender/xrender.c: * bind_pixmap: the reply `r` is not freed * blur: reg_op_resized is not freed Spotted-by: Samuel Hand <samuel.d.hand@gmail.com> Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
c4369ec756
commit
c5145479b0
|
@ -168,6 +168,7 @@ static bool blur(backend_t *backend_data, double opacity, void *ctx_,
|
|||
if (!tmp_picture[0] || !tmp_picture[1]) {
|
||||
log_error("Failed to build intermediate Picture.");
|
||||
pixman_region32_fini(®_op);
|
||||
pixman_region32_fini(®_op_resized);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -244,6 +245,7 @@ static bool blur(backend_t *backend_data, double opacity, void *ctx_,
|
|||
xcb_render_free_picture(c, tmp_picture[0]);
|
||||
xcb_render_free_picture(c, tmp_picture[1]);
|
||||
pixman_region32_fini(®_op);
|
||||
pixman_region32_fini(®_op_resized);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -268,6 +270,8 @@ bind_pixmap(backend_t *base, xcb_pixmap_t pixmap, struct xvisual_info fmt, bool
|
|||
x_create_picture_with_visual_and_pixmap(base->c, fmt.visual, pixmap, 0, NULL);
|
||||
img->owned = owned;
|
||||
img->visual = fmt.visual;
|
||||
free(r);
|
||||
|
||||
if (img->pict == XCB_NONE) {
|
||||
free(img);
|
||||
return NULL;
|
||||
|
|
|
@ -411,6 +411,7 @@ static inline void expose_root(session_t *ps, const rect_t *rects, int nrects) {
|
|||
region_t region;
|
||||
pixman_region32_init_rects(®ion, rects, nrects);
|
||||
add_damage(ps, ®ion);
|
||||
pixman_region32_fini(®ion);
|
||||
}
|
||||
|
||||
static inline void ev_expose(session_t *ps, xcb_expose_event_t *ev) {
|
||||
|
|
Loading…
Reference in New Issue