mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-24 17:57:48 +03:00
raid: use internal variables for array alloc
Don't use passed pointer when allocating policies' array. (In case policy_argc would be NULL, this would have caused NULL dereference).
This commit is contained in:
parent
89615af349
commit
96cf9dc017
@ -1121,9 +1121,9 @@ int lv_cache_policy_info(struct logical_volume *lv,
|
||||
*policy_argc = status->policy_argc;
|
||||
if (policy_argv) {
|
||||
if (!(*policy_argv =
|
||||
dm_pool_zalloc(mem, sizeof(char *) * *policy_argc)))
|
||||
dm_pool_zalloc(mem, sizeof(char *) * status->policy_argc)))
|
||||
return_0;
|
||||
for (i = 0; i < *policy_argc; i++)
|
||||
for (i = 0; i < status->policy_argc; ++i)
|
||||
if (!((*policy_argv)[i] =
|
||||
dm_pool_strdup(mem, status->policy_argv[i])))
|
||||
return_0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user