diff options
author | Dan McGee <dan@archlinux.org> | 2007-09-10 19:13:38 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-09-11 20:41:42 -0500 |
commit | 2f0de317b862e154f0b172da0668b887413cc55f (patch) | |
tree | 97435c2dd2608c793f5ccd144faef0d3aa78e0a9 /src/pacman/conf.c | |
parent | b2501950c7fca0b771fc79054d9592ea79753749 (diff) |
Make some small changes recommended by splint
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/conf.c')
-rw-r--r-- | src/pacman/conf.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c index a4fd1318..2bc69820 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -30,29 +30,29 @@ config_t *config_new(void) { - config_t *config = calloc(1, sizeof(config_t)); - if(!config) { + config_t *newconfig = calloc(1, sizeof(config_t)); + if(!newconfig) { fprintf(stderr, "malloc failure: could not allocate %d bytes\n", sizeof(config_t)); } /* defaults which may get overridden later */ - config->op = PM_OP_MAIN; - config->logmask = PM_LOG_ERROR | PM_LOG_WARNING; + newconfig->op = PM_OP_MAIN; + newconfig->logmask = PM_LOG_ERROR | PM_LOG_WARNING; /* CONFFILE is defined at compile-time */ - config->configfile = strdup(CONFFILE); + newconfig->configfile = strdup(CONFFILE); - return(config); + return(newconfig); } -int config_free(config_t *config) +int config_free(config_t *oldconfig) { - if(config == NULL) { + if(oldconfig == NULL) { return(-1); } - free(config->configfile); - free(config); - config = NULL; + free(oldconfig->configfile); + free(oldconfig); + oldconfig = NULL; return(0); } |