Code

sysdb: Fixed a memory leak on EOF from the server.
[sysdb.git] / 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: ");