Changeset 2377


Ignore:
Timestamp:
Aug 26, 2018 3:27:55 PM (8 months ago)
Author:
unxusr
Message:

leak in CbcMain1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/2.9/Cbc/src/CbcSolver.cpp

    r2360 r2377  
    13421342    int statistics_nprocessedrows = 0, statistics_nprocessedcols = 0;
    13431343    std::string statistics_result;
    1344     int * statistics_number_cuts = NULL;
     1344    int *statistics_number_cuts = NULL;
    13451345    const char ** statistics_name_generators = NULL;
    13461346    int statistics_number_generators = 0;
     
    70617061
    70627062                                numberGenerators = babModel_->numberCutGenerators();
     7063                                if (statistics_number_cuts)
     7064                                    delete[] statistics_number_cuts;
    70637065                                statistics_number_cuts = new int [numberGenerators];;
    70647066                                statistics_number_generators = numberGenerators;
     
    70937095                                    << CoinMessageEol;
    70947096                                }
     7097
    70957098#ifdef COIN_DEVELOP
    70967099                                printf("%d solutions found by heuristics\n",
     
    91439146                                    statistics_nprocessedrows, statistics_nprocessedcols);
    91449147                            for (int i = 0; i < statistics_number_generators; i++)
    9145                                 fprintf(fp, ",%d", statistics_number_cuts[i]);
     9148                                fprintf(fp, ",%d", (statistics_number_cuts!=NULL) ? statistics_number_cuts[i] : 0 );
    91469149                            fprintf(fp, ",");
    91479150                            for (int i = 1; i < argc; i++) {
     
    99789981    }
    99799982#endif
    9980     delete [] statistics_number_cuts;
     9983    if (statistics_number_cuts != NULL)
     9984        delete [] statistics_number_cuts;
    99819985    delete [] statistics_name_generators;
    99829986    // By now all memory should be freed
Note: See TracChangeset for help on using the changeset viewer.