1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Fix resource leak when strdup fails

Static analyzer noticed, strdup failing path leaks dmt structure.
This commit is contained in:
Zdenek Kabelac 2011-08-31 08:23:05 +00:00
parent 04e647aa84
commit 316d14d45f

View 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);