[Nut-upsdev] Possible error in drivers/main-hal.c
Arnaud Quette
aquette.dev at gmail.com
Thu Jun 21 07:46:56 UTC 2007
2007/6/6, Arjen de Korte <nut+devel at de-korte.org>:
> 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'.
good catch, thanks Arjen.
fixed on Testing and trunk.
there is still a cleanup to be done here, but I'm now getting more
visibility on where we'll go with the HAL bridge.
Arnaud
--
Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
OpenSource Developer - http://arnaud.quette.free.fr/
More information about the Nut-upsdev
mailing list