Allocate name with plain malloc & free.
static void _unknown_destroy(struct segment_type *segtype)
{
+ dm_free(segtype->name);
dm_free(segtype);
}
}
segtype->ops = &_unknown_ops;
- segtype->name = dm_pool_strdup(cmd->libmem, name);
+ if (!(segtype->name = dm_strdup(name))) {
+ log_error("Failed to allocate name.");
+ dm_free(segtype);
+ return NULL;
+ }
+
segtype->flags = SEG_UNKNOWN | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
log_very_verbose("Initialised segtype: %s", segtype->name);