summaryrefslogtreecommitdiff
path: root/zebra/zebra_dplane.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@users.noreply.github.com>2022-02-10 10:24:22 -0300
committerGitHub <noreply@github.com>2022-02-10 10:24:22 -0300
commit70d79c359b321337c3791944ef068917b24748b6 (patch)
tree1eedaa44fc6faad007d14b0e68188966e950e2d5 /zebra/zebra_dplane.c
parent7fe008261e34ad957f70f3e0bc8a6a342cf1aff8 (diff)
parentb6b6e59c6ea0a00a73862d8f40d8b5745350f7e5 (diff)
Merge pull request #10537 from mjstapp/fix_dplane_strdup
zebra: use frr mem apis in dplane
Diffstat (limited to 'zebra/zebra_dplane.c')
-rw-r--r--zebra/zebra_dplane.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index 4d32e54d1f..9f9270db9a 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -722,7 +722,7 @@ static void dplane_ctx_free_internal(struct zebra_dplane_ctx *ctx)
/* 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;
@@ -1854,7 +1854,7 @@ void dplane_ctx_set_intf_label(struct zebra_dplane_ctx *ctx, const char *label)
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;
@@ -1869,7 +1869,7 @@ void dplane_ctx_set_intf_label(struct zebra_dplane_ctx *ctx, const char *label)
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;
@@ -3705,7 +3705,7 @@ static enum zebra_dplane_result intf_addr_update_internal(
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);
}
}