module/i3: plug valgrind detected memory leak

Free previous 'application' string before replacing it with a new one.
This commit is contained in:
Daniel Eklöf 2019-09-22 00:44:51 +02:00
parent 12feaf1ccd
commit 393e1909b7
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -395,6 +395,7 @@ handle_window_event(int type, const struct json_object *json, void *_mod)
assert(bytes >= 0);
application[bytes - 1] = '\0';
free(ws->window.application);
ws->window.application = strdup(application);
close(fd);
}