IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10913


Ignore:
Timestamp:
Jan 4, 2007, 6:29:34 PM (19 years ago)
Author:
jhoblitt
Message:

plug some memory leaks

File:
1 edited

Legend:

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

    r10440 r10913  
    3434
    3535    config->modules = pmConfigRead(&argc, argv, NULL);
    36 
    37 
    38     if (! config->modules) {
    39         psErrorStackPrint(stderr, "Can't find site configuration!\n");
    40         exit(EXIT_FAILURE);
     36    if (!config->modules) {
     37        psError(PS_ERR_UNKNOWN, false, "Can't find site configuration");
     38        goto FAIL;
    4139    }
    4240
     
    8078        psArgumentHelp(arguments);
    8179        psFree(arguments);
    82         exit(EXIT_FAILURE);
     80        goto FAIL;
    8381    }
    8482
     
    8684        psArgumentHelp(arguments);
    8785        psFree(arguments);
    88         exit(EXIT_FAILURE);
     86        goto FAIL;
    8987    }
    9088
     
    9593        psArgumentHelp(arguments);
    9694        psFree(arguments);
    97         exit(EXIT_FAILURE);
     95        goto FAIL;
    9896    }
    9997
     
    104102    if (!config->dbh) {
    105103        psError(PS_ERR_UNKNOWN, false, "Can't configure database");
    106         exit(EXIT_FAILURE);
     104        goto FAIL;
    107105    }
    108106
     107    // save argv/argc
     108    config->argv = argv;
     109    config->argc = argc;
     110
    109111    return config;
     112
     113FAIL:
     114    psFree(config);
     115    pmConfigDone();
     116    psLibFinalize();
     117    exit(EXIT_FAILURE);
    110118}
    111119
Note: See TracChangeset for help on using the changeset viewer.