Hello Markus
The reporter is correct and the code is wrong.
Em ter?a-feira, 3 de maio de 2016, ?s 03:28:21 PDT, Markus Jung escreveu:
> Hi,
> Thiago or Vijay could you have a look on this issue?
> Thanks
> Markus
>
> ------- Original Message -------
> Sender : Annie Weng<annie.weng at u-media.com.tw>
> Date : May 03, 2016 11:55 (GMT+09:00)
> Title : [dev] About IotivityandZigbeeServer.c
>
> Hi,
> My colleague found something wired in IotivityandZigbeeServer.c.
> (plugins/samples/linux/IotivityandZigbeeServer.c) A pointer is freed but it
> will be used.
> It is in function SetDeviceInfo(), as the red lines below.
>
> OCStackResult SetDeviceInfo()
> {
> static OCDeviceInfo deviceInfo =
> {
> .deviceName = "IoTivity/Zigbee Server Sample",
> };
> char *dup = OICStrdup("oic.wk.d");
> deviceInfo.types = (OCStringLL *)OICCalloc(1, sizeof(OCStringLL));
> deviceInfo.types->value = dup;
> OICFree(dup);
> return OCSetDeviceInfo(deviceInfo);
> }
>
> Could someone help to check it?
>
> Thank you & Best Regards,
> Annie
>
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center