Changeset 11860 for trunk/ippTools/src/pztoolConfig.c
- Timestamp:
- Feb 16, 2007, 12:29:15 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pztoolConfig.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pztoolConfig.c
r11702 r11860 27 27 #include "pztool.h" 28 28 29 // this function can not fail -- exits on error 30 pxConfig *pztoolConfig(pxConfig *config, int argc, char **argv){29 pxConfig *pztoolConfig(pxConfig *config, int argc, char **argv) 30 { 31 31 if (!config) { 32 32 config = pxConfigAlloc(); … … 39 39 if (! config->modules) { 40 40 psError(PS_ERR_UNKNOWN, false, "Can't find site configuration!\n"); 41 exit(EXIT_FAILURE); 41 psFree(config); 42 return NULL; 42 43 } 43 44 … … 103 104 if (config->mode) { \ 104 105 psError(PS_ERR_UNKNOWN, true, "only one mode selection is allowed"); \ 105 goto FAIL; \ 106 psFree(config); \ 107 return NULL; \ 106 108 } \ 107 109 config->mode = modeval; \ … … 148 150 149 151 psFree(argSets); 150 goto FAIL; 152 psFree(config); 153 return NULL; 151 154 } 152 155 … … 161 164 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\ 162 165 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 163 goto FAIL; \ 166 psFree(config); \ 167 return NULL; \ 164 168 } \ 165 169 } \ … … 178 182 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) { 179 183 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 180 goto FAIL; 184 psFree(config); 185 return NULL; 181 186 } 182 187 } … … 197 202 if (!config->dbh) { 198 203 psError(PS_ERR_UNKNOWN, false, "Can't configure database"); 199 goto FAIL; 204 psFree(config); 205 return NULL; 200 206 } 201 207 … … 205 211 206 212 return config; 207 208 FAIL:209 psFree(config);210 pmConfigDone();211 psLibFinalize();212 exit(EXIT_FAILURE);213 213 }
Note:
See TracChangeset
for help on using the changeset viewer.
