]> git.ozlabs.org Git - petitboot/commit
discover/udev: fix double free on udev_init failures
authorJeremy Kerr <jk@ozlabs.org>
Thu, 17 Apr 2014 03:40:09 +0000 (11:40 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 17 Apr 2014 03:50:39 +0000 (11:50 +0800)
commit8245f2555d8a253238be888cf3e5693a2e7cbefc
tree20a4b6a0946d37d5fcd5f5384163217e8bd180c4
parenta1fb38f17bfa60aac89d0dd21dd8ccc739d794bf
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 <jk@ozlabs.org>
discover/udev.c