IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9690 for trunk/psLib/src/db


Ignore:
Timestamp:
Oct 20, 2006, 3:09:37 PM (20 years ago)
Author:
jhoblitt
Message:

fix psTime related memory leaks in p_psDBRunQueryPrepared()

File:
1 edited

Legend:

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

    r9681 r9690  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.105 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-10-21 00:33:00 $
     14 *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-10-21 01:09:37 $
    1616 *
    1717 *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
     
    880880        psMetadata *rowData = rowSet->data[j];
    881881
    882         psDBMysqlRowRecycle(mysqlRow);
    883 
    884882        if (!psDBPackMySQLRow(mysqlRow, rowData)) {
    885883            psError(PS_ERR_UNKNOWN, false, "Failed to pack params into bind structure.");
     
    908906            return -1;
    909907        }
     908
     909        // free temporary buffers
     910        psDBMysqlRowRecycle(mysqlRow);
     911
    910912    } // end loop over rows
    911913
     
    11681170
    11691171                bind[i].buffer  = myTime;
    1170                 bind[i].buffer_length = 0;
     1172                bind[i].buffer_length = sizeof(MYSQL_TIME);
    11711173                bind[i].length  = &bind[i].buffer_length;
    11721174                bind[i].is_null = NULL;
     
    12321234        }
    12331235    }
     1236
     1237    memset(bind, '\0', sizeof(MYSQL_BIND) * mysqlRow->n);
    12341238}
    12351239
Note: See TracChangeset for help on using the changeset viewer.