use talloc_zero_size instead of talloc_size
This commit is contained in:
parent
fe338bf5c9
commit
eaea30c774
|
@ -160,7 +160,7 @@ struct gsmd_timer *gsmd_timer_alloc(void)
|
|||
{
|
||||
struct gsmd_timer *tmr;
|
||||
|
||||
tmr = talloc_size(__tmr_ctx, sizeof(*tmr));
|
||||
tmr = talloc_zero_size(__tmr_ctx, sizeof(*tmr));
|
||||
return tmr;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ static void *__ucmd_ctx, *__gu_ctx;
|
|||
|
||||
struct gsmd_ucmd *ucmd_alloc(int extra_size)
|
||||
{
|
||||
return talloc_size(__ucmd_ctx,
|
||||
return talloc_zero_size(__ucmd_ctx,
|
||||
sizeof(struct gsmd_ucmd) + extra_size);
|
||||
}
|
||||
|
||||
|
@ -986,7 +986,7 @@ static int network_opers_parse(const char *str, struct gsmd_msg_oper **out)
|
|||
str++;
|
||||
}
|
||||
|
||||
*out = talloc_size(__gu_ctx, sizeof(struct gsmd_msg_oper) * (len + 1));
|
||||
*out = talloc_zero_size(__gu_ctx, sizeof(struct gsmd_msg_oper) * (len + 1));
|
||||
|
||||
if (!out)
|
||||
return -ENOMEM;
|
||||
|
@ -1120,7 +1120,7 @@ static int network_ownnumbers_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
|
|||
else
|
||||
len = 0;
|
||||
|
||||
num = talloc_size(__gu_ctx, sizeof(*num) + len + 1);
|
||||
num = talloc_zero_size(__gu_ctx, sizeof(*num) + len + 1);
|
||||
if (len)
|
||||
ret = sscanf(resp, "+CNUM: \"%[^\"]\",\"%32[^\"]\",%i,%*i,%i,",
|
||||
num->name, num->addr.number,
|
||||
|
|
Loading…
Reference in New Issue