Changeset 27222


Ignore:
Timestamp:
08/21/22 16:45:30 (3 years ago)
Author:
Eric.Larour
Message:

CHG: fixed simple memory leaks.

Location:
issm/branches/trunk-larour-SLPS2022/src/c/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-SLPS2022/src/c/classes/FemModel.cpp

    r27212 r27222  
    46914691        }
    46924692        xDelete<IssmDouble*>(response_partitions);
     4693        xDelete<int>(response_partitions_npart);
    46934694
    46944695}
  • issm/branches/trunk-larour-SLPS2022/src/c/classes/Params/DoubleMatArrayParam.cpp

    r25508 r27222  
    161161        if(out_M){
    162162                out_array=xNew<IssmDouble*>(M);
    163                 out_mdim_array=xNew<int>(M);
    164                 out_ndim_array=xNew<int>(M);
    165 
    166                 xMemCpy<int>(out_mdim_array,this->mdim_array,M);
    167                 xMemCpy<int>(out_ndim_array,this->ndim_array,M);
     163                if(pout_mdim_array){
     164                        out_mdim_array=xNew<int>(M);
     165                        xMemCpy<int>(out_mdim_array,this->mdim_array,M);
     166                }
     167                if(pout_ndim_array){
     168                        out_ndim_array=xNew<int>(M);
     169                        xMemCpy<int>(out_ndim_array,this->ndim_array,M);
     170                }
    168171
    169172                for(i=0;i<this->M;i++){
Note: See TracChangeset for help on using the changeset viewer.