[PATCH] Fix leaks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 usbredirhost/usbredirhost.c             | 1 +
 usbredirtestclient/usbredirtestclient.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
index bbaafa4..6ab6e1b 100644
--- a/usbredirhost/usbredirhost.c
+++ b/usbredirhost/usbredirhost.c
@@ -1191,6 +1191,7 @@ static void usbredirhost_alloc_stream_unlocked(struct usbredirhost *host,
                 host->endpoint[EP2I(ep)].transfer[i], INTERRUPT_TIMEOUT);
             break;
         }
+        free(buffer);
     }
     host->endpoint[EP2I(ep)].out_idx = 0;
     host->endpoint[EP2I(ep)].drop_packets = 0;
diff --git a/usbredirtestclient/usbredirtestclient.c b/usbredirtestclient/usbredirtestclient.c
index 42b16dc..32fcba2 100644
--- a/usbredirtestclient/usbredirtestclient.c
+++ b/usbredirtestclient/usbredirtestclient.c
@@ -404,6 +404,9 @@ static int usbredirtestclient_cmdline_ctrl(void)
     }
     usbredirparser_send_control_packet(parser, id, &control_packet,
                                        data, data_len);
+    if (data) {
+        free(data);
+    }
     printf("Send control packet with id: %u\n", id);
     id++;
     return 1;
-- 
1.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]