mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Replace malloc with zalloc when creating segment_type's
This commit is contained in:
parent
09c4fd3f55
commit
58bdd1654b
@ -99,7 +99,7 @@ static struct segtype_handler _error_ops = {
|
|||||||
|
|
||||||
struct segment_type *init_error_segtype(struct cmd_context *cmd)
|
struct segment_type *init_error_segtype(struct cmd_context *cmd)
|
||||||
{
|
{
|
||||||
struct segment_type *segtype = dm_malloc(sizeof(*segtype));
|
struct segment_type *segtype = dm_zalloc(sizeof(*segtype));
|
||||||
|
|
||||||
if (!segtype)
|
if (!segtype)
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
@ -43,7 +43,7 @@ static struct segtype_handler _freeseg_ops = {
|
|||||||
|
|
||||||
struct segment_type *init_free_segtype(struct cmd_context *cmd)
|
struct segment_type *init_free_segtype(struct cmd_context *cmd)
|
||||||
{
|
{
|
||||||
struct segment_type *segtype = dm_malloc(sizeof(*segtype));
|
struct segment_type *segtype = dm_zalloc(sizeof(*segtype));
|
||||||
|
|
||||||
if (!segtype)
|
if (!segtype)
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
@ -630,7 +630,7 @@ struct segment_type *init_segtype(struct cmd_context *cmd);
|
|||||||
struct segment_type *init_segtype(struct cmd_context *cmd)
|
struct segment_type *init_segtype(struct cmd_context *cmd)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
struct segment_type *segtype = dm_malloc(sizeof(*segtype));
|
struct segment_type *segtype = dm_zalloc(sizeof(*segtype));
|
||||||
|
|
||||||
if (!segtype)
|
if (!segtype)
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
@ -760,7 +760,7 @@ int init_multiple_segtype(struct segtype_library *seglib)
|
|||||||
{
|
{
|
||||||
struct segment_type *segtype;
|
struct segment_type *segtype;
|
||||||
|
|
||||||
if (!(segtype = dm_malloc(sizeof(*segtype))))
|
if (!(segtype = dm_zalloc(sizeof(*segtype))))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
segtype->ops = &_replicator_ops;
|
segtype->ops = &_replicator_ops;
|
||||||
@ -773,7 +773,7 @@ int init_multiple_segtype(struct segtype_library *seglib)
|
|||||||
|
|
||||||
log_very_verbose("Initialised segtype: " REPLICATOR_MODULE);
|
log_very_verbose("Initialised segtype: " REPLICATOR_MODULE);
|
||||||
|
|
||||||
if (!(segtype = dm_malloc(sizeof(*segtype))))
|
if (!(segtype = dm_zalloc(sizeof(*segtype))))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
segtype->ops = &_replicator_dev_ops;
|
segtype->ops = &_replicator_dev_ops;
|
||||||
|
@ -249,7 +249,7 @@ struct segment_type *init_segtype(struct cmd_context *cmd);
|
|||||||
struct segment_type *init_segtype(struct cmd_context *cmd)
|
struct segment_type *init_segtype(struct cmd_context *cmd)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
struct segment_type *segtype = dm_malloc(sizeof(*segtype));
|
struct segment_type *segtype = dm_zalloc(sizeof(*segtype));
|
||||||
|
|
||||||
if (!segtype)
|
if (!segtype)
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
@ -220,7 +220,7 @@ static struct segtype_handler _striped_ops = {
|
|||||||
|
|
||||||
struct segment_type *init_striped_segtype(struct cmd_context *cmd)
|
struct segment_type *init_striped_segtype(struct cmd_context *cmd)
|
||||||
{
|
{
|
||||||
struct segment_type *segtype = dm_malloc(sizeof(*segtype));
|
struct segment_type *segtype = dm_zalloc(sizeof(*segtype));
|
||||||
|
|
||||||
if (!segtype)
|
if (!segtype)
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
@ -91,7 +91,7 @@ static struct segtype_handler _unknown_ops = {
|
|||||||
|
|
||||||
struct segment_type *init_unknown_segtype(struct cmd_context *cmd, const char *name)
|
struct segment_type *init_unknown_segtype(struct cmd_context *cmd, const char *name)
|
||||||
{
|
{
|
||||||
struct segment_type *segtype = dm_malloc(sizeof(*segtype));
|
struct segment_type *segtype = dm_zalloc(sizeof(*segtype));
|
||||||
|
|
||||||
if (!segtype)
|
if (!segtype)
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
@ -96,7 +96,7 @@ static struct segtype_handler _zero_ops = {
|
|||||||
|
|
||||||
struct segment_type *init_zero_segtype(struct cmd_context *cmd)
|
struct segment_type *init_zero_segtype(struct cmd_context *cmd)
|
||||||
{
|
{
|
||||||
struct segment_type *segtype = dm_malloc(sizeof(*segtype));
|
struct segment_type *segtype = dm_zalloc(sizeof(*segtype));
|
||||||
|
|
||||||
if (!segtype)
|
if (!segtype)
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user