Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11df024f authored by George Burgess IV's avatar George Burgess IV Committed by android-build-merger
Browse files

Merge "amrnb: Fix memory leaks" am: beb800f0 am: 7521f507

am: a6665ce4

Change-Id: I99293013025b19c9b898ae461689d12df85073be
parents 160ddb09 a6665ce4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ Word16 lsp_init(lspState **st)
    *st = NULL;

    /* allocate memory */
    if ((s = (lspState *) malloc(sizeof(lspState))) == NULL)
    if ((s = (lspState *) calloc(sizeof(lspState), 1)) == NULL)
    {
        /* fprintf(stderr, "lsp_init: can not malloc state structure\n"); */
        return -1;
@@ -182,11 +182,13 @@ Word16 lsp_init(lspState **st)
    /* Initialize quantization state */
    if (0 != Q_plsf_init(&s->qSt))
    {
        lsp_exit(&s);
        return -1;
    }

    if (0 != lsp_reset(s))
    {
        lsp_exit(&s);
        return -1;
    }

+1 −7
Original line number Diff line number Diff line
@@ -268,13 +268,7 @@ Word16 GSMInitDecode(void **state_data,
    if (Decoder_amr_init(&s->decoder_amrState)
            || Post_Process_reset(&s->postHP_state))
    {
        Speech_Decode_FrameState *tmp = s;
        /*
         *  dereferencing type-punned pointer avoid
         *  breaking strict-aliasing rules
         */
        void** tempVoid = (void**) tmp;
        GSMDecodeFrameExit(tempVoid);
        free(s);
        return (-1);
    }