diff --git a/lib/error/errseg.c b/lib/error/errseg.c index add1df8cb..41e451b9c 100644 --- a/lib/error/errseg.c +++ b/lib/error/errseg.c @@ -99,7 +99,7 @@ static struct segtype_handler _error_ops = { 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) return_NULL; diff --git a/lib/freeseg/freeseg.c b/lib/freeseg/freeseg.c index 8e73be0c6..6fbad7ec7 100644 --- a/lib/freeseg/freeseg.c +++ b/lib/freeseg/freeseg.c @@ -43,7 +43,7 @@ static struct segtype_handler _freeseg_ops = { 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) return_NULL; diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c index 9da8efaa6..3c68adab1 100644 --- a/lib/mirror/mirrored.c +++ b/lib/mirror/mirrored.c @@ -630,7 +630,7 @@ struct segment_type *init_segtype(struct cmd_context *cmd); struct segment_type *init_segtype(struct cmd_context *cmd) #endif { - struct segment_type *segtype = dm_malloc(sizeof(*segtype)); + struct segment_type *segtype = dm_zalloc(sizeof(*segtype)); if (!segtype) return_NULL; diff --git a/lib/replicator/replicator.c b/lib/replicator/replicator.c index 26a5cf1c0..2be49c2fc 100644 --- a/lib/replicator/replicator.c +++ b/lib/replicator/replicator.c @@ -760,7 +760,7 @@ int init_multiple_segtype(struct segtype_library *seglib) { struct segment_type *segtype; - if (!(segtype = dm_malloc(sizeof(*segtype)))) + if (!(segtype = dm_zalloc(sizeof(*segtype)))) return_0; segtype->ops = &_replicator_ops; @@ -773,7 +773,7 @@ int init_multiple_segtype(struct segtype_library *seglib) log_very_verbose("Initialised segtype: " REPLICATOR_MODULE); - if (!(segtype = dm_malloc(sizeof(*segtype)))) + if (!(segtype = dm_zalloc(sizeof(*segtype)))) return_0; segtype->ops = &_replicator_dev_ops; diff --git a/lib/snapshot/snapshot.c b/lib/snapshot/snapshot.c index af5d70895..1b8b20ff5 100644 --- a/lib/snapshot/snapshot.c +++ b/lib/snapshot/snapshot.c @@ -249,7 +249,7 @@ struct segment_type *init_segtype(struct cmd_context *cmd); struct segment_type *init_segtype(struct cmd_context *cmd) #endif { - struct segment_type *segtype = dm_malloc(sizeof(*segtype)); + struct segment_type *segtype = dm_zalloc(sizeof(*segtype)); if (!segtype) return_NULL; diff --git a/lib/striped/striped.c b/lib/striped/striped.c index 51bf24a1e..4de4a1876 100644 --- a/lib/striped/striped.c +++ b/lib/striped/striped.c @@ -220,7 +220,7 @@ static struct segtype_handler _striped_ops = { 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) return_NULL; diff --git a/lib/unknown/unknown.c b/lib/unknown/unknown.c index 332ae99e0..b2183717a 100644 --- a/lib/unknown/unknown.c +++ b/lib/unknown/unknown.c @@ -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 *segtype = dm_malloc(sizeof(*segtype)); + struct segment_type *segtype = dm_zalloc(sizeof(*segtype)); if (!segtype) return_NULL; diff --git a/lib/zero/zero.c b/lib/zero/zero.c index 16ce66c40..471bc11f9 100644 --- a/lib/zero/zero.c +++ b/lib/zero/zero.c @@ -96,7 +96,7 @@ static struct segtype_handler _zero_ops = { 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) return_NULL;