Commit 6d25aecb authored by malenov's avatar malenov
Browse files

instrument calloc()/free() calls of main enc/dec structs

parent 9ad0efa5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -52,9 +52,11 @@ int main(int argc, char *argv[])
     *   - Find frame length
     *------------------------------------------------------------------------------------------*/

#undef WMC_TOOL_SKIP
    if ( (st_fx = (Decoder_State_fx *) calloc(1, sizeof(Decoder_State_fx) ) ) == NULL )
    {
    }
#define WMC_TOOL_SKIP

    /*------------------------------------------------------------------------------------------*
     * I/O initializations
@@ -88,7 +90,9 @@ int main(int argc, char *argv[])
        IF( decodeVoip(st_fx, f_stream, f_synth, jbmFECoffsetFileName, quietMode ) != 0 )
#endif
        {
#undef WMC_TOOL_SKIP
            free( st_fx );
#define WMC_TOOL_SKIP
            fclose( f_synth );
            fclose( f_stream );
            return -1;
@@ -235,7 +239,9 @@ int main(int argc, char *argv[])
    }

    /* free memory etc. */
#undef WMC_TOOL_SKIP
    free( st_fx );
#define WMC_TOOL_SKIP
    fclose( f_synth );
    fclose( f_stream );

+4 −0
Original line number Diff line number Diff line
@@ -73,11 +73,13 @@ int main( int argc, char** argv )
     * Encoder initialization
     *------------------------------------------------------------------------------------------*/

#undef WMC_TOOL_SKIP
    if ( (st_fx = (Encoder_State_fx *) calloc( 1, sizeof(Encoder_State_fx) ) ) == NULL )
    {
        fprintf(stderr, "Can not allocate memory for encoder state structure\n");
        exit(-1);
    }
#define WMC_TOOL_SKIP

    io_ini_enc_fx( argc, argv, &f_input, &f_stream, &f_rate, &f_bwidth,
                   &f_rf,
@@ -254,7 +256,9 @@ int main( int argc, char** argv )
    {
        /* common delete function */
        destroy_encoder_fx( st_fx );
#undef WMC_TOOL_SKIP
        free(st_fx);
#define WMC_TOOL_SKIP
    }

#ifdef WMOPS