summaryrefslogtreecommitdiffstats
path: root/src/msgb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/msgb.c')
-rw-r--r--src/msgb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/msgb.c b/src/msgb.c
index 82902b40..844cfc61 100644
--- a/src/msgb.c
+++ b/src/msgb.c
@@ -79,14 +79,16 @@ struct msgb *msgb_alloc(uint16_t size, const char *name)
{
struct msgb *msg;
- msg = _talloc_zero(tall_msgb_ctx, sizeof(*msg) + size, name);
-
+ msg = talloc_named_const(tall_msgb_ctx, sizeof(*msg) + size, name);
if (!msg) {
LOGP(DLGLOBAL, LOGL_FATAL, "Unable to allocate a msgb: "
"name='%s', size=%u\n", name, size);
return NULL;
}
+ /* Manually zero-initialize allocated memory */
+ memset(msg, 0x00, sizeof(*msg) + size);
+
msg->data_len = size;
msg->len = 0;
msg->data = msg->_data;