Commit f4115b1a authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge branch...

Merge branch 'basop-2333-clang18-asan-memory-leaks-in-lib_rend-ivas_mcmasa_ana_fx-c-246-9' into 'main'

Resolve "[CLANG18] ASAN: memory leaks in lib_rend/ivas_mcmasa_ana_fx.c:246:9"

Closes #2333

See merge request !2720
parents dde137b5 0b9682fb
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@
#define FIX_BASOP_2328_MSAN_WRONG_ASSIGNMENT            /* Nokia: basop issue 2328: Fix MSAN error by correcting the variable assignment */
#define FIX_BASOP_2329_UNINIT_VALUE                     /* Nokia: basop issue 2329: Fix issue by checking for structure instead of length */
#define FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND  /* Nokia: basop issue 2332: Uses predefined memory sizes instead computing wrong */
#define FIX_BASOP_2333_MCMASA_ANA_MEMORY_LEAK           /* Nokia: basop issue 2333: Add missing free for direction_vector_e to ivas_mcmasa_ana_fx.c */

/* #################### End BE switches ################################## */

+14 −3
Original line number Diff line number Diff line
@@ -423,14 +423,25 @@ void ivas_mcmasa_ana_close(
            ( *hMcMasa )->direction_vector_m_fx[i][j] = NULL;
        }

        free( ( *hMcMasa )->direction_vector_m_fx[i] );
        ( *hMcMasa )->direction_vector_m_fx[i] = NULL;
#ifdef FIX_BASOP_2333_MCMASA_ANA_MEMORY_LEAK

        FOR( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ )
        {
            free( ( *hMcMasa )->direction_vector_e[i][j] );
            ( *hMcMasa )->direction_vector_e[i][j] = NULL;
        }

        free( ( *hMcMasa )->direction_vector_e[i] );
        ( *hMcMasa )->direction_vector_e[i] = NULL;
#endif

        FOR( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ )
        {
            free( ( *hMcMasa )->buffer_intensity_real_fx[i][j] );
            ( *hMcMasa )->buffer_intensity_real_fx[i][j] = NULL;
        }

        free( ( *hMcMasa )->direction_vector_m_fx[i] );
        ( *hMcMasa )->direction_vector_m_fx[i] = NULL;
    }

    FOR( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ )