summaryrefslogtreecommitdiff
path: root/lib/unknown
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2018-06-08 13:40:53 +0100
committerJoe Thornber <ejt@redhat.com>2018-06-08 13:40:53 +0100
commitd5da55ed85248adb066d293c2a1b863ce17d2779 (patch)
treee526dd2f773e3016a3acd3cb8e490ed11ba7c439 /lib/unknown
parentc78239d8605f333915543c0e0c3ccf4f4ef5ee8f (diff)
downloadlvm2-d5da55ed85248adb066d293c2a1b863ce17d2779.tar.gz
device_mapper: remove dbg_malloc.
I wrote dbg_malloc before we had valgrind. These days there's just no need.
Diffstat (limited to 'lib/unknown')
-rw-r--r--lib/unknown/unknown.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/unknown/unknown.c b/lib/unknown/unknown.c
index 7c2a54cd8..b7c06ace6 100644
--- a/lib/unknown/unknown.c
+++ b/lib/unknown/unknown.c
@@ -12,6 +12,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "base/memory/zalloc.h"
#include "lib/misc/lib.h"
#include "lib/commands/toolcontext.h"
#include "lib/metadata/segtype.h"
@@ -49,8 +50,8 @@ static int _unknown_text_export(const struct lv_segment *seg, struct formatter *
static void _unknown_destroy(struct segment_type *segtype)
{
- dm_free((void *) segtype->name);
- dm_free(segtype);
+ free((void *) segtype->name);
+ free(segtype);
}
static struct segtype_handler _unknown_ops = {
@@ -61,7 +62,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_zalloc(sizeof(*segtype));
+ struct segment_type *segtype = zalloc(sizeof(*segtype));
if (!segtype) {
log_error("Failed to allocate memory for unknown segtype");
@@ -69,9 +70,9 @@ struct segment_type *init_unknown_segtype(struct cmd_context *cmd, const char *n
}
segtype->ops = &_unknown_ops;
- if (!(segtype->name = dm_strdup(name))) {
+ if (!(segtype->name = strdup(name))) {
log_error("Failed to allocate name.");
- dm_free(segtype);
+ free(segtype);
return NULL;
}