- fixed: client control object crashes when orIdent is set to NULL -> now sends empty octet string

This commit is contained in:
Michael Zillgith 2016-06-18 09:59:07 -03:00
parent 3abf055cfc
commit 61534daa99
2 changed files with 7 additions and 1 deletions

View file

@ -57,6 +57,8 @@ int main(int argc, char** argv) {
MmsValue* ctlVal = MmsValue_newBoolean(true);
ControlObjectClient_setOrigin(control, NULL, 3);
if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) {
printf("simpleIOGenericIO/GGIO1.SPCSO1 operated successfully\n");
}

View file

@ -422,7 +422,11 @@ ControlObjectClient_setOrigin(ControlObjectClient self, const char* orIdent, int
if (self->orIdent != NULL)
GLOBAL_FREEMEM(self->orIdent);
self->orIdent = copyString(orIdent);
if (orIdent != NULL)
self->orIdent = copyString(orIdent);
else
self->orIdent = NULL;
self->orCat = orCat;
}