IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9388


Ignore:
Timestamp:
Oct 6, 2006, 5:55:24 PM (20 years ago)
Author:
magnier
Message:

do not free the supplied output on error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadata.c

    r8973 r9388  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.135 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-09-26 02:55:34 $
     14 *  @version $Revision: 1.136 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-10-07 03:55:24 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    418418                           const psMetadata *in)
    419419{
    420     //    PS_ASSERT_PTR_NON_NULL(in,NULL);
     420    // in == NULL is a valid input, return 'out' as is
    421421    if (in == NULL) {
    422         if (out != NULL) {
    423             psFree(out);
    424             out = NULL;
    425         }
    426         return out;
    427     }
     422        psError(PS_ERR_BAD_PARAMETER_NULL, true, "psMetadataCopy: 'in' cannot be NULL");
     423        return NULL;
     424    }
     425
    428426    //    PS_ASSERT_PTR_NON_NULL(in->list,NULL);
    429427    if (in->list == NULL) {
    430         if (out != NULL) {
    431             psFree(out);
    432             out = NULL;
    433         }
    434         return out;
     428        psError(PS_ERR_BAD_PARAMETER_NULL, true, "psMetadataCopy: 'in' has NULL list");
     429        return NULL;
    435430    }
    436431
     
    457452            psFree(newItem);
    458453            psFree(iter);
    459             psFree(out);
    460             out = NULL;
    461             return out;
     454            return NULL;
    462455        }
    463456        psFree(newItem);                // Drop reference
    464457    }
    465458    psFree(iter);
    466 
    467459    return out;
    468460}
Note: See TracChangeset for help on using the changeset viewer.