diff --git a/GRESB/gresb.c b/GRESB/gresb.c
index 78f9b8bd364c2270bd03ab90eeb1264d5c671298..40e53bae9f2214d3da0e8af48b4ebaa61d360756 100644
--- a/GRESB/gresb.c
+++ b/GRESB/gresb.c
@@ -139,7 +139,7 @@ uint8_t *gresb_create_host_data_pkt(const uint8_t *data, uint32_t len)
 	struct host_to_gresb_pkt *pkt;
 
 
-	pkt = malloc(sizeof(struct host_to_gresb_pkt));
+	pkt = malloc(sizeof(struct host_to_gresb_pkt) + len);
 	if (!pkt)
 		return NULL;