Fix memory leak in i3-msg. (#2542)

relates to #2541
This commit is contained in:
Ingo Bürk 2016-11-06 17:14:37 +01:00 committed by Michael Stapelberg
parent e48119adfe
commit 9c6a21f2d4
1 changed files with 3 additions and 2 deletions

View File

@ -240,9 +240,10 @@ int main(int argc, char *argv[]) {
/* For the reply of commands, have a look if that command was successful. /* For the reply of commands, have a look if that command was successful.
* If not, nicely format the error message. */ * If not, nicely format the error message. */
if (reply_type == I3_IPC_MESSAGE_TYPE_COMMAND) { if (reply_type == I3_IPC_MESSAGE_TYPE_COMMAND) {
yajl_handle handle; yajl_handle handle = yajl_alloc(&reply_callbacks, NULL, NULL);
handle = yajl_alloc(&reply_callbacks, NULL, NULL);
yajl_status state = yajl_parse(handle, (const unsigned char *)reply, reply_length); yajl_status state = yajl_parse(handle, (const unsigned char *)reply, reply_length);
yajl_free(handle);
switch (state) { switch (state) {
case yajl_status_ok: case yajl_status_ok:
break; break;