summaryrefslogtreecommitdiff
path: root/daemons/dmeventd/dmeventd.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2011-08-31 08:23:05 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2011-08-31 08:23:05 +0000
commit316d14d45f87278c30e4f52f03182faefadb3160 (patch)
tree815a9c042e1bdd61ef42ad85949d6e9fe6227973 /daemons/dmeventd/dmeventd.c
parent04e647aa84daac107dc6d486fb966967a8be97ff (diff)
downloadlvm2-316d14d45f87278c30e4f52f03182faefadb3160.tar.gz
Fix resource leak when strdup fails
Static analyzer noticed, strdup failing path leaks dmt structure.
Diffstat (limited to 'daemons/dmeventd/dmeventd.c')
-rw-r--r--daemons/dmeventd/dmeventd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index ec514ee98..791c47dd9 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -751,8 +751,10 @@ static struct dm_task *_get_device_status(struct thread_status *ts)
if (!dmt)
return NULL;
- if (!dm_task_set_uuid(dmt, ts->device.uuid))
- return NULL;
+ if (!dm_task_set_uuid(dmt, ts->device.uuid)) {
+ dm_task_destroy(dmt);
+ return NULL;
+ }
if (!dm_task_run(dmt)) {
dm_task_destroy(dmt);