IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10074


Ignore:
Timestamp:
Nov 17, 2006, 6:04:14 PM (19 years ago)
Author:
jhoblitt
Message:

fix mem corruption & leaks

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pxadminConfig.c

    r10054 r10074  
    3434
    3535    config->modules = pmConfigRead(&argc, argv);
     36
    3637
    3738    if (! config->modules) {
     
    9798    }
    9899
     100   psFree(arguments);
     101
    99102    // define Database handle, if used
    100103    config->dbh = pmConfigDB(config->modules);
     
    103106        exit(EXIT_FAILURE);
    104107    }
    105 
    106     config->args = arguments;
    107108
    108109    return config;
  • trunk/ippTools/src/pxtables.c

    r10037 r10074  
    4040
    4141bool pxCreateTables(pxConfig *config) {
    42     bool            status = true;
    43 
    4442    PS_ASSERT_PTR_NON_NULL(config, false);
    4543
     
    5250    }
    5351#endif
     52
     53    bool            status = true;
    5454    CREATE_TABLE(summitExpCreateTable);
    5555    CREATE_TABLE(summitImfileCreateTable);
     
    102102    fgets (line, 128, stdin);
    103103    sscanf (line, "%s", answer);
    104     if (strcmp (answer, "YES")) goto escape;
     104    if (strcmp (answer, "YES"))  {
     105        psError(PS_ERR_UNKNOWN, true, "tables NOT deleleted");
     106        return false;
     107    }
    105108
    106109    fprintf (stdout, "enter dbh connection password: ");
     
    111114        bool status;
    112115        psString dbPassword = psMetadataLookupStr(&status, config->modules->site, "DBPASSWORD");
    113         if (strcmp (answer, dbPassword)) goto escape;
    114         psFree(dbPassword);
     116        if (strcmp (answer, dbPassword)) {
     117            psError(PS_ERR_UNKNOWN, true, "tables NOT deleleted");
     118            return false;
     119        }
    115120    }
    116121
     
    151156
    152157    return status;
    153 
    154 escape:
    155     // XXX fix psMetadataLookupStr() to inc ref count
    156     // psFree(dbPassword);
    157     fprintf (stdout, "tables NOT deleted\n");
    158 
    159     return false;
    160158}
Note: See TracChangeset for help on using the changeset viewer.