IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 6, 2006, 3:00:46 PM (20 years ago)
Author:
jhoblitt
Message:

always check the return of psDBMySQLToPType() for errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.c

    r8756 r8758  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.89 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-09-07 00:40:21 $
     14 *  @version $Revision: 1.90 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-09-07 01:00:46 $
    1616 *
    1717 *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
     
    654654        // find ptype of column
    655655        pType = psDBMySQLToPType(field[i].type, field[i].flags);
     656        if (pType < 0) {
     657            psError(PS_ERR_UNKNOWN, false, "Failed to lookup type.");
     658            psFree(table);
     659            mysql_free_result(result);
     660            return NULL;
     661        }
    656662        //psLogMsg( __func__, PS_LOG_INFO, "pType=[%ld]\n", pType );
    657663
     
    975981            // lookup MySQL column type
    976982            pType = psDBMySQLToPType(field[i].type, field[i].flags);
     983            if (pType < 0) {
     984                psError(PS_ERR_UNKNOWN, false, "Failed to lookup type.");
     985                psFree(md);
     986                mysql_free_result(result);
     987                return NULL;
     988            }
    977989
    978990            len = fieldLength[i];
Note: See TracChangeset for help on using the changeset viewer.