/* Maybe free label string, if allocated */
if (ctx->u.intf.label != NULL &&
ctx->u.intf.label != ctx->u.intf.label_buf) {
- free(ctx->u.intf.label);
+ XFREE(MTYPE_DP_CTX, ctx->u.intf.label);
ctx->u.intf.label = NULL;
}
break;
DPLANE_CTX_VALID(ctx);
if (ctx->u.intf.label && ctx->u.intf.label != ctx->u.intf.label_buf)
- free(ctx->u.intf.label);
+ XFREE(MTYPE_DP_CTX, ctx->u.intf.label);
ctx->u.intf.label = NULL;
sizeof(ctx->u.intf.label_buf));
ctx->u.intf.label = ctx->u.intf.label_buf;
} else {
- ctx->u.intf.label = strdup(label);
+ ctx->u.intf.label = XSTRDUP(MTYPE_DP_CTX, label);
}
} else {
ctx->u.intf.flags &= ~DPLANE_INTF_HAS_LABEL;
sizeof(ctx->u.intf.label_buf));
ctx->u.intf.label = ctx->u.intf.label_buf;
} else {
- ctx->u.intf.label = strdup(ifc->label);
+ ctx->u.intf.label = XSTRDUP(MTYPE_DP_CTX, ifc->label);
}
}