diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2013-07-10 13:49:26 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-07-10 15:14:00 -0400 |
commit | b2cf1c7154577f7f8b9f2404c4a41019db314116 (patch) | |
tree | 2069d48492c64bfe4ce461b44b088093aef67311 /src/udev/udevd.c | |
parent | 5957c143c1b417f040527133daa86c7014822d2c (diff) |
Fix potential memleak and use-after-free errors as reported by clang
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udevd.c')
-rw-r--r-- | src/udev/udevd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 44318814c9..a923ce740b 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -162,6 +162,7 @@ static void worker_cleanup(struct worker *worker) udev_monitor_unref(worker->monitor); children--; free(worker); + worker = NULL; } static void worker_unref(struct worker *worker) @@ -1308,7 +1309,7 @@ int main(int argc, char *argv[]) worker->state = WORKER_KILLED; /* drop reference taken for state 'running' */ worker_unref(worker); - if (worker->event) { + if (worker && worker->event) { log_error("seq %llu '%s' killed\n", udev_device_get_seqnum(worker->event->dev), worker->event->devpath); worker->event->exitcode = -64; |