Changeset 11844 for trunk/ippTools/src/camtoolConfig.c
- Timestamp:
- Feb 15, 2007, 3:59:13 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/camtoolConfig.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/camtoolConfig.c
r11771 r11844 28 28 #include "p3tool.h" 29 29 30 // this function can not fail -- exits on error 31 pxConfig *p3toolConfig(pxConfig *config, int argc, char **argv){30 pxConfig *p3toolConfig(pxConfig *config, int argc, char **argv) 31 { 32 32 if (!config) { 33 33 config = pxConfigAlloc(); … … 40 40 if (!config->modules) { 41 41 psError(PS_ERR_UNKNOWN, false, "Can't find site configuration"); 42 goto FAIL; 42 psFree(config); 43 return NULL; 43 44 } 44 45 … … 150 151 if (config->mode) { \ 151 152 psError(PS_ERR_UNKNOWN, true, "only one mode selection is allowed"); \ 152 goto FAIL; \ 153 psFree(config); \ 154 return NULL; \ 153 155 } \ 154 156 config->mode = modeval; \ … … 198 200 199 201 psFree(argSets); 200 goto FAIL; 202 psFree(config); 203 return NULL; 201 204 } 202 205 … … 211 214 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\ 212 215 psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \ 213 goto FAIL; \ 216 psFree(config); \ 217 return NULL; \ 214 218 } \ 215 219 } \ … … 227 231 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) { 228 232 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 229 goto FAIL; 233 psFree(config); 234 return NULL; 230 235 } 231 236 } … … 239 244 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", imfiles)) { 240 245 psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles"); 241 goto FAIL; 246 psFree(config); 247 return NULL; 242 248 } 243 249 } … … 257 263 if (!config->dbh) { 258 264 psError(PS_ERR_UNKNOWN, false, "Can't configure database"); 259 goto FAIL; 265 psFree(config); 266 return NULL; 260 267 } 261 268 … … 264 271 config->argc = argc; 265 272 266 267 273 return config; 268 269 FAIL:270 psFree(config);271 pmConfigDone();272 psLibFinalize();273 exit(EXIT_FAILURE);274 274 }
Note:
See TracChangeset
for help on using the changeset viewer.
