diff options
Diffstat (limited to 'randpkt_core/randpkt_core.c')
-rw-r--r-- | randpkt_core/randpkt_core.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/randpkt_core/randpkt_core.c b/randpkt_core/randpkt_core.c index 3233d625a9..06f9ab910f 100644 --- a/randpkt_core/randpkt_core.c +++ b/randpkt_core/randpkt_core.c @@ -558,25 +558,22 @@ randpkt_example* randpkt_find_example(int type) void randpkt_loop(randpkt_example* example, guint64 produce_count) { - guint i; - int j; + guint i, j; int err; - int len_random; - int len_this_pkt; + guint len_random; + guint len_this_pkt; gchar* err_info; union wtap_pseudo_header* ps_header; - guint8 buffer[65536]; + guint8* buffer; struct wtap_pkthdr* pkthdr; pkthdr = g_new0(struct wtap_pkthdr, 1); + buffer = (guint8*)g_malloc0(65536); pkthdr->rec_type = REC_TYPE_PACKET; pkthdr->presence_flags = WTAP_HAS_TS; pkthdr->pkt_encap = example->sample_wtap_encap; - memset(pkthdr, 0, sizeof(struct wtap_pkthdr)); - memset(buffer, 0, sizeof(buffer)); - ps_header = &pkthdr->pseudo_header; /* Load the sample pseudoheader into our pseudoheader buffer */ @@ -678,6 +675,7 @@ void randpkt_loop(randpkt_example* example, guint64 produce_count) } g_free(pkthdr); + g_free(buffer); } gboolean randpkt_example_close(randpkt_example* example) |