From ad8d9031316536e8faa39238790fe2cf8cf5fdb9 Mon Sep 17 00:00:00 2001 From: Nathan Hoad Date: Sat, 15 Feb 2014 21:02:59 +1100 Subject: [PATCH] Don't free the screen resources reply until we absolutely have to. On my system, premature free'ing resulted in an error at the xcb_randr_get_output_info_reply call, so randr didn't work at all. --- bar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bar.c b/bar.c index bf94dd7..ab46069 100644 --- a/bar.c +++ b/bar.c @@ -414,7 +414,6 @@ get_randr_outputs(void) num = xcb_randr_get_screen_resources_current_outputs_length(rres_reply); outputs = xcb_randr_get_screen_resources_current_outputs(rres_reply); config_timestamp = rres_reply->config_timestamp; - free(rres_reply); if (num < 1) { fprintf(stderr, "Failed to get current randr outputs\n"); return; @@ -497,6 +496,7 @@ get_randr_outputs(void) j++; } } + free(rres_reply); } void