From b69047064ad9134977c234da163c0a14dc45aa35 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 29 Feb 2016 12:54:31 +0100 Subject: [PATCH] Replaced stream manipulation with EnsureCapacity. --- server/Sample/sfreerdp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 96b6c9c..9095f4a 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -441,17 +441,13 @@ BOOL tf_peer_dump_rfx(freerdp_peer* client) while (pcap_has_next_record(pcap_rfx)) { - BYTE* tmp = NULL; if (!pcap_get_next_record_header(pcap_rfx, &record)) break; - tmp = realloc(Stream_Buffer(s), record.length); - if (!tmp) + if (!Stream_EnsureCapacity(s, record.length)) break; - Stream_SetBuffer(s, tmp); record.data = Stream_Buffer(s); - Stream_SetCapacity(s, record.length); pcap_get_next_record_content(pcap_rfx, &record); Stream_SetPointer(s, Stream_Buffer(s) + Stream_Capacity(s)); -- 2.7.4