mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 21:50:39 +00:00
Merge pull request #10537 from mjstapp/fix_dplane_strdup
zebra: use frr mem apis in dplane
This commit is contained in:
commit
70d79c359b
@ -722,7 +722,7 @@ static void dplane_ctx_free_internal(struct zebra_dplane_ctx *ctx)
|
|||||||
/* Maybe free label string, if allocated */
|
/* Maybe free label string, if allocated */
|
||||||
if (ctx->u.intf.label != NULL &&
|
if (ctx->u.intf.label != NULL &&
|
||||||
ctx->u.intf.label != ctx->u.intf.label_buf) {
|
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;
|
ctx->u.intf.label = NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1854,7 +1854,7 @@ void dplane_ctx_set_intf_label(struct zebra_dplane_ctx *ctx, const char *label)
|
|||||||
DPLANE_CTX_VALID(ctx);
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
|
||||||
if (ctx->u.intf.label && ctx->u.intf.label != ctx->u.intf.label_buf)
|
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;
|
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));
|
sizeof(ctx->u.intf.label_buf));
|
||||||
ctx->u.intf.label = ctx->u.intf.label_buf;
|
ctx->u.intf.label = ctx->u.intf.label_buf;
|
||||||
} else {
|
} else {
|
||||||
ctx->u.intf.label = strdup(label);
|
ctx->u.intf.label = XSTRDUP(MTYPE_DP_CTX, label);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ctx->u.intf.flags &= ~DPLANE_INTF_HAS_LABEL;
|
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));
|
sizeof(ctx->u.intf.label_buf));
|
||||||
ctx->u.intf.label = ctx->u.intf.label_buf;
|
ctx->u.intf.label = ctx->u.intf.label_buf;
|
||||||
} else {
|
} else {
|
||||||
ctx->u.intf.label = strdup(ifc->label);
|
ctx->u.intf.label = XSTRDUP(MTYPE_DP_CTX, ifc->label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user