Commit fd6fbc5e authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/hotfix-nr-rlc-cppcheck' into integration_2024_w45 (!3098)

and simplify a bit (DevAssert instead of goto/exit)
parents 1898e347 752fa5fd
......@@ -32,13 +32,14 @@ nr_rlc_sdu_segment_t *nr_rlc_new_sdu(
{
/* allocate sdu header and data together */
nr_rlc_sdu_t *sdu = malloc(sizeof(nr_rlc_sdu_t) + size);
nr_rlc_sdu_segment_t *ret = calloc(1, sizeof(nr_rlc_sdu_segment_t));
DevAssert(sdu != NULL);
DevAssert(ret != NULL);
/* only memset the header */
memset(sdu, 0 , sizeof(*sdu));
nr_rlc_sdu_segment_t *ret = calloc(1, sizeof(nr_rlc_sdu_segment_t));
if (sdu == NULL || ret == NULL)
goto oom;
sdu->ref_count = 1;
sdu->sn = -1; /* set later */
sdu->upper_layer_id = upper_layer_id;
......@@ -54,10 +55,6 @@ nr_rlc_sdu_segment_t *nr_rlc_new_sdu(
ret->is_last = 1;
return ret;
oom:
LOG_E(RLC, "%s:%d:%s: out of memory\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
int nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment