diff options
author | dequis <dx@dxzone.com.ar> | 2015-09-16 03:36:48 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-10-08 01:58:59 -0300 |
commit | c2969f9feb1878cc9dbe143b7adeda56b66557e6 (patch) | |
tree | 964c89d938250425681ec53c22901f95f18587e8 | |
parent | 3cbf71d6e8232b8309e927b9f17857ac079a016f (diff) |
conf, help: Fix minor leaks in error conditions
From coverity.
-rw-r--r-- | conf.c | 4 | ||||
-rw-r--r-- | help.c | 1 |
2 files changed, 5 insertions, 0 deletions
@@ -73,6 +73,7 @@ conf_t *conf_load(int argc, char *argv[]) i = conf_loadini(conf, global.conf_file); if (i == 0) { fprintf(stderr, "Error: Syntax error in configuration file `%s'.\n", global.conf_file); + conf_free(conf); return NULL; } else if (i == -1) { config_missing++; @@ -135,10 +136,12 @@ conf_t *conf_load(int argc, char *argv[]) " -x Command-line interface to password encryption/hashing\n" " -h Show this help page.\n" " -V Show version info.\n"); + conf_free(conf); return NULL; } else if (opt == 'V') { printf("BitlBee %s\nAPI version %06x\n", BITLBEE_VERSION, BITLBEE_VERSION_CODE); + conf_free(conf); return NULL; } else if (opt == 'u') { g_free(conf->user); @@ -162,6 +165,7 @@ conf_t *conf_load(int argc, char *argv[]) /* Let's treat this as a serious problem so people won't think they're secure when in fact they're not. */ fprintf(stderr, "Error: Could not read CA file %s: %s\n", conf->cafile, strerror(errno)); + conf_free(conf); return NULL; } @@ -145,6 +145,7 @@ char *help_get(help_t **help, char *title) if (lseek(h->fd, h->offset.file_offset, SEEK_SET) == -1 || read(h->fd, s, h->length) != h->length) { + g_free(s); return NULL; } } else { |