diff options
author | Ingo Bürk <admin@airblader.de> | 2016-11-06 17:14:37 +0100 |
---|---|---|
committer | Michael Stapelberg <stapelberg@users.noreply.github.com> | 2016-11-06 08:14:37 -0800 |
commit | 9c6a21f2d42c14985c7f95d8a42253d98921d794 (patch) | |
tree | 6f2df47f107e24f8da25e9f2fb2a5d7d720ab3b7 /i3-msg | |
parent | e48119adfef9527d4a10d4d5fa5cf9bea816bbf1 (diff) | |
download | i3-9c6a21f2d42c14985c7f95d8a42253d98921d794.tar.gz i3-9c6a21f2d42c14985c7f95d8a42253d98921d794.zip |
Fix memory leak in i3-msg. (#2542)
relates to #2541
Diffstat (limited to 'i3-msg')
-rw-r--r-- | i3-msg/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/i3-msg/main.c b/i3-msg/main.c index 915d326f..02e156a1 100644 --- a/i3-msg/main.c +++ b/i3-msg/main.c @@ -240,9 +240,10 @@ int main(int argc, char *argv[]) { /* For the reply of commands, have a look if that command was successful. * If not, nicely format the error message. */ if (reply_type == I3_IPC_MESSAGE_TYPE_COMMAND) { - yajl_handle handle; - handle = yajl_alloc(&reply_callbacks, NULL, NULL); + yajl_handle handle = yajl_alloc(&reply_callbacks, NULL, NULL); yajl_status state = yajl_parse(handle, (const unsigned char *)reply, reply_length); + yajl_free(handle); + switch (state) { case yajl_status_ok: break; |