]> sourceware.org Git - lvm2.git/commitdiff
Fix resource leak when strdup fails
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 31 Aug 2011 08:23:05 +0000 (08:23 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 31 Aug 2011 08:23:05 +0000 (08:23 +0000)
Static analyzer noticed, strdup failing path leaks dmt structure.

daemons/dmeventd/dmeventd.c

index ec514ee98029a7497db25fd578365f32649bb70d..791c47dd93880a48505f3145ee46f1e89daee5fb 100644 (file)
@@ -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);
This page took 0.038445 seconds and 5 git commands to generate.