[Nut-upsdev] Possible error in drivers/main-hal.c
Arjen de Korte
nut+devel at de-korte.org
Wed Jun 6 20:10:47 UTC 2007
Looking at the above sources, it looks like the device_path is
configured twice:
509 device_path = xstrdup("auto"); /*getenv ("HAL_PROP_HIDDEV_DEVICE"); */
626 device_path = xstrdup(argv[0]);
Other than the fact that we leak a few bytes of memory here by using
xstrdup() twice without free'ing in between, I don't think this is what
we intended to do. It looks to me that the socket will now be named
'usbhid-ups-usbhid-ups', which would be ugly? Since I don't use HAL, I
can't verify this, but I think we really want it to look like
'usbhid-ups-auto'.
Best regards, Arjen
More information about the Nut-upsdev
mailing list