Fix use-after-free with block hotspots

This commit is contained in:
Drew DeVault 2018-04-02 11:53:56 -04:00
parent 0cbd2a4f49
commit c507727ad2
4 changed files with 14 additions and 8 deletions

View file

@ -30,9 +30,7 @@ static bool i3bar_parse_json(struct status_line *status, const char *text) {
status_error(status, "[failed to parse i3bar json]");
return false;
}
if (json_object_array_length(results) < 1) {
return true;
}
wlr_log(L_DEBUG, "Got i3bar json: '%s'", text);
for (size_t i = 0; i < json_object_array_length(results); ++i) {
json_object *full_text, *short_text, *color, *min_width, *align, *urgent;
json_object *name, *instance, *separator, *separator_block_width;