mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
libdm: reorder error path
Coverity noticed recent fix of an error path missed to release 'dmt' - reoder code to ensure 'dmt' is released.
This commit is contained in:
parent
a45cc0fe14
commit
6d0db97163
@ -1270,13 +1270,12 @@ char *dm_stats_print_region(struct dm_stats *dms, uint64_t region_id,
|
|||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
if (!(response = dm_task_get_message_response(dmt)))
|
if (!(response = dm_task_get_message_response(dmt)))
|
||||||
return_0;
|
goto_out;
|
||||||
|
|
||||||
resp = dm_pool_strdup(dms->mem, response);
|
if (!(resp = dm_pool_strdup(dms->mem, response)))
|
||||||
dm_task_destroy(dmt);
|
|
||||||
|
|
||||||
if (!resp)
|
|
||||||
log_error("Could not allocate memory for response buffer.");
|
log_error("Could not allocate memory for response buffer.");
|
||||||
|
out:
|
||||||
|
dm_task_destroy(dmt);
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user