From df2a3b61518dc36fcfa93d570cbe649a63ff4f55 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 4 Nov 2019 23:07:26 +1100 Subject: [PATCH] [porthole] bug fixes --- porthole/src/linux/client.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/porthole/src/linux/client.c b/porthole/src/linux/client.c index 84a034d2..82ee35d3 100644 --- a/porthole/src/linux/client.c +++ b/porthole/src/linux/client.c @@ -112,7 +112,7 @@ bool porthole_client_open( return false; } - *handle = (PortholeClient)calloc(sizeof(PortholeClient), 1); + *handle = (PortholeClient)calloc(sizeof(struct PortholeClient), 1); (*handle)->socket = fd; (*handle)->map_cb = map_cb; @@ -389,8 +389,10 @@ static void porthole_do_map(PortholeClient handle, Mapping * map, const uint32_t const unsigned int count = objectlist_count(map->segments); PortholeMap *m = calloc(sizeof(PortholeMap) + sizeof(PortholeSegment) * count, 1); - m->id = map->id; - m->size = map->size; + + m->id = map->id; + m->size = map->size; + m->num_segments = count; for(unsigned int i = 0; i < count; ++i) {