diff --git a/src/goose/goose_publisher.c b/src/goose/goose_publisher.c index 1abf067d..a80bfaf8 100644 --- a/src/goose/goose_publisher.c +++ b/src/goose/goose_publisher.c @@ -117,18 +117,28 @@ GoosePublisher_destroy(GoosePublisher self) void GoosePublisher_setGoID(GoosePublisher self, char* goID) { + if (self->goID != NULL) + GLOBAL_FREEMEM(self->goID); + self->goID = StringUtils_copyString(goID); } void GoosePublisher_setGoCbRef(GoosePublisher self, char* goCbRef) { + if (self->goCBRef != NULL) + GLOBAL_FREEMEM(self->goCBRef); + self->goCBRef = StringUtils_copyString(goCbRef); } void GoosePublisher_setDataSetRef(GoosePublisher self, char* dataSetRef) { + + if (self->dataSetRef != NULL) + GLOBAL_FREEMEM(self->dataSetRef); + self->dataSetRef = StringUtils_copyString(dataSetRef); }