wmbattery: Fix memory leak.
commit13d3321f14a1acd457a8a9a1f824add31173c4d1
authorDoug Torrance <dtorrance@piedmont.edu>
Mon, 6 Nov 2017 14:56:52 +0000 (6 09:56 -0500)
committerCarlos R. Mafra <crmafra@gmail.com>
Mon, 6 Nov 2017 16:36:06 +0000 (6 16:36 +0000)
treeb327b212d4403462bc06dd06d400e4a8fd61ffe6
parent6434c272b3e7a8bca26be90417eabfd26bcce554
wmbattery: Fix memory leak.

Patch by David Johnson <davijoh3@cisco.com> to fix Debian bug #816872 [1]:

> wmbattery appears to have a memory leak.  When invoked with "wmbattery -w 2"
> it is leaking approx 350KB/minute on my system.  Eventually it runs out of
> memory and is killed by kernel.

...

> I've concluded libupower-glib is just super leaky.  The below patch
> moves the upower API calls into a child process that doesn't exist for
> long to keep the leaks out of the main process.

> Tested against stretch versions, looks good.

[1] https://bugs.debian.org/816872
wmbattery/upower.c