From 120410a4d1d6a7a9df4865301ec127c4f3acdd86 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Sun, 1 May 2016 21:08:56 +0100 Subject: src/wallpaper.c: free up some data allocated by X. The if statements are needed because we cannot pass a NULL pointer to XFree. --- src/wallpaper.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wallpaper.c b/src/wallpaper.c index b6f2c0c..eb33a0c 100644 --- a/src/wallpaper.c +++ b/src/wallpaper.c @@ -550,6 +550,13 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, } } } + + if (data_root) + XFree(data_root); + + if (data_esetroot) + XFree(data_esetroot); + /* This will locate the property, creating it if it doesn't exist */ prop_root = XInternAtom(disp2, "_XROOTPMAP_ID", False); prop_esetroot = XInternAtom(disp2, "ESETROOT_PMAP_ID", False); -- cgit v1.2.3 From 1db314934f025b080908a0794c41d70a15120d67 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 2 May 2016 14:48:39 +0200 Subject: always initialize data_root and data_esetroot --- src/wallpaper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallpaper.c b/src/wallpaper.c index eb33a0c..a11a50d 100644 --- a/src/wallpaper.c +++ b/src/wallpaper.c @@ -292,7 +292,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, Atom prop_root, prop_esetroot, type; int format, i; unsigned long length, after; - unsigned char *data_root, *data_esetroot; + unsigned char *data_root = NULL, *data_esetroot = NULL; Pixmap pmap_d1, pmap_d2; gib_list *l; -- cgit v1.2.3