IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 955


Ignore:
Timestamp:
Jun 9, 2004, 11:26:34 AM (22 years ago)
Author:
desonia
Message:

Fixed memory leak by adding a missed psFree.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sysUtils/tst_psMemory.c

    r848 r955  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-06-04 02:08:42 $
     8 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-06-09 21:26:34 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7070    const int size = 100;
    7171    int failed = 0;
    72     int currentId = psMemGetId();
    7372
    7473    psLogMsg(__func__,PS_LOG_INFO,"psAlloc shall allocate memory blocks writeable by caller.\n");
     
    9089    }
    9190
    92     psMemCheckLeaks(currentId,NULL,NULL);
    93     psMemCheckCorruption(1);
     91    psFree(mem);
    9492
    9593    return failed;
     
    10098    // create memory
    10199    int* mem;
    102     int currentId = psMemGetId();
    103100    int ref = 0;
    104101
     
    144141    psFree(mem);
    145142
    146     psMemCheckLeaks(currentId,NULL,NULL);
    147     psMemCheckCorruption(1);
    148 
    149143    return 0;
    150144}
     
    154148int TPOutOfMemory(void)
    155149{
    156     int currentId = psMemGetId();
    157150    int* mem1 = NULL;
    158151    int* mem2 = NULL;
     
    182175    psFree(mem4);
    183176
    184     psMemCheckLeaks(currentId,NULL,NULL);
    185     psMemCheckCorruption(1);
    186 
    187177    return 0;
    188178}
     
    191181int TPrealloc(void)
    192182{
    193     int currentId = psMemGetId();
    194183    int* mem1;
    195184    int* mem2;
     
    246235    psFree(mem3);
    247236
    248     psMemCheckLeaks(currentId,NULL,NULL);
    249     psMemCheckCorruption(1);
    250 
    251237    return 0;
    252238}
     
    305291        return 1;
    306292    }
    307 
    308     psMemCheckLeaks(currentId,NULL,NULL);
    309     psMemCheckCorruption(1);
    310293
    311294    return 0;
     
    413396    psFree(buffers[3]);
    414397
    415     psMemCheckLeaks(currentId,NULL,NULL);
    416     psMemCheckCorruption(1);
    417 
    418398    return 0;
    419399}
Note: See TracChangeset for help on using the changeset viewer.