mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: do not return stack content
Return initialized struct in error path.
This commit is contained in:
parent
aed4e9c703
commit
dedec81d7b
@ -593,15 +593,16 @@ struct lvm_property_value lvm_lv_params_get_property(
|
||||
const lv_create_params_t params,
|
||||
const char *name)
|
||||
{
|
||||
struct lvm_property_value rc;
|
||||
|
||||
rc.is_valid = 0;
|
||||
struct lvm_property_value rc = {
|
||||
.is_valid = 0
|
||||
};
|
||||
|
||||
if (params && params->magic == LV_CREATE_PARAMS_MAGIC) {
|
||||
rc = get_property(NULL, NULL, NULL, NULL, NULL, ¶ms->lvp, name);
|
||||
} else {
|
||||
log_error("Invalid lv_create_params parameter");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user