From: Jeremy Kerr Date: Thu, 17 Apr 2014 03:40:09 +0000 (+0800) Subject: discover/udev: fix double free on udev_init failures X-Git-Tag: v1.0.0~185 X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=8245f2555d8a253238be888cf3e5693a2e7cbefc;hp=8245f2555d8a253238be888cf3e5693a2e7cbefc discover/udev: fix double free on udev_init failures If the udev monitor or enumerate functions fail, we'll call the udev_unref and udev_monitor_unref functions twice: once in the cleanup path and once in the talloc destructor. This change moves all cleanup to the talloc destructor, so we only do the unrefs once. Signed-off-by: Jeremy Kerr ---