Changeset 9240
- Timestamp:
- Oct 4, 2006, 1:13:21 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r9232 r9240 538 538 539 539 // insert 'newImfile's into rawImfile 540 if (psArrayLength( newImfiles) > 0) {540 if (psArrayLength(output) > 0) { 541 541 // start a transaction so we don't end up half of the imfiles we were 542 542 // trying to update uninserted 543 543 if (!psDBTransaction(config->dbh)) { 544 544 psError(PS_ERR_UNKNOWN, false, "database error"); 545 psFree( newImfiles);546 return false; 547 } 548 549 for (long i = 0; i < psArrayLength( newImfiles); i++) {545 psFree(output); 546 return false; 547 } 548 549 for (long i = 0; i < psArrayLength(output); i++) { 550 550 // convert newImfile metadata -> newImfile object 551 newImfileRow *object = newImfileObjectFromMetadata( newImfiles->data[i]);551 newImfileRow *object = newImfileObjectFromMetadata(output->data[i]); 552 552 // convert newImfile object -> rawImfile object 553 553 rawImfileRow *imfile = newToRawImfile(config, object); … … 559 559 psError(PS_ERR_UNKNOWN, false, "failed to create a new rawImfile row"); 560 560 psFree(object); 561 psFree( newImfiles);561 psFree(output); 562 562 return false; 563 563 } … … 571 571 psFree(imfile); 572 572 psFree(object); 573 psFree( newImfiles);573 psFree(output); 574 574 return false; 575 575 } … … 583 583 psError(PS_ERR_UNKNOWN, false, "failed to delete row from the database"); 584 584 psFree(object); 585 psFree( newImfiles);585 psFree(output); 586 586 return false; 587 587 } … … 592 592 if (!psDBCommit(config->dbh)) { 593 593 psError(PS_ERR_UNKNOWN, false, "database error"); 594 psFree( newImfiles);595 return false; 596 } 597 } 598 599 psFree( newImfiles);594 psFree(output); 595 return false; 596 } 597 } 598 599 psFree(output); 600 600 601 601 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
