Code

sysdb: Fixed a memory leak on EOF from the server.
authorSebastian Harl <sh@tokkee.org>
Sat, 19 Jul 2014 12:20:03 +0000 (14:20 +0200)
committerSebastian Harl <sh@tokkee.org>
Sat, 19 Jul 2014 12:20:03 +0000 (14:20 +0200)
src/tools/sysdb/command.c

index be41b15f9d92557588df6b9fefc326a261a80844..505124cae243b8e974c1790f8d04290e38f6c4c4 100644 (file)
@@ -61,8 +61,10 @@ sdb_command_print_reply(sdb_client_t *client)
        if (sdb_client_recv(client, &rcode, recv_buf) < 0)
                rcode = UINT32_MAX;
 
-       if (sdb_client_eof(client))
+       if (sdb_client_eof(client)) {
+               sdb_strbuf_destroy(recv_buf);
                return -1;
+       }
 
        if (rcode == UINT32_MAX) {
                printf("ERROR: ");