From b06c2f0ca2a4e49d7cc1859839c8a745934a829c Mon Sep 17 00:00:00 2001 From: fptk <fptk@zedat.fu-berlin.de> Date: Fri, 26 Feb 2021 16:12:40 +0100 Subject: [PATCH] fix zonefree --- ArtyImplementation/shared/ZoneMessage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArtyImplementation/shared/ZoneMessage.c b/ArtyImplementation/shared/ZoneMessage.c index 47f1a53..e249960 100644 --- a/ArtyImplementation/shared/ZoneMessage.c +++ b/ArtyImplementation/shared/ZoneMessage.c @@ -3,14 +3,14 @@ void initZoneMessage(struct ZoneMessage *zm) { + zm = malloc(sizeof(struct ZoneMessage)); zm->len = 0; zm->data = NULL; } void freeZoneMessage(struct ZoneMessage *zm) { - if(zm->data != NULL) - free(zm->data); - + zm->data; + free(zm); } void setZoneMessage(struct ZoneMessage *zm, char *data, uint16_t length) -- GitLab