summaryrefslogtreecommitdiffstats
path: root/proxy/src
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-06-25 16:07:42 -0400
committerGünther Deschner <gdeschner@redhat.com>2013-06-27 18:07:23 +0200
commitf66a585e042fbb2f313c1cbde329088fac86cea6 (patch)
tree235f36862e97a302a4b0fc3c6c45e1b29d1d7080 /proxy/src
parent6cf727aad695466f45125bd30da5b2c2e2e9d48d (diff)
downloadgss-proxy-f66a585e042fbb2f313c1cbde329088fac86cea6.tar.gz
gss-proxy-f66a585e042fbb2f313c1cbde329088fac86cea6.tar.xz
gss-proxy-f66a585e042fbb2f313c1cbde329088fac86cea6.zip
Coverity fixes.
Fix a 4 coverity issues, ranging from memory leaks, to uninitialized variables, to potential NULL derefernce. Also a TOCTOU report that is in one of the accessory test scripts. The bug itself is not reallya TOCTOU, but the check done in the script is unecessary, so I just removed it. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
Diffstat (limited to 'proxy/src')
-rw-r--r--proxy/src/gp_config.c14
-rw-r--r--proxy/src/mechglue/gpp_import_and_canon_name.c2
2 files changed, 9 insertions, 7 deletions
diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c
index 1b676d3..5051a91 100644
--- a/proxy/src/gp_config.c
+++ b/proxy/src/gp_config.c
@@ -33,12 +33,14 @@
static void free_str_array(const char ***a, int *count)
{
- const char **array = *a;
+ const char **array;
int i;
if (!a) {
return;
}
+ array = *a;
+
if (count) {
for (i = 0; i < *count; i++) {
safefree(array[i]);
@@ -282,13 +284,13 @@ static int gp_init_ini_context(const char *config_file,
}
ret = gp_config_init(config_file, ctx);
+
if (ret) {
- return ret;
+ free(ctx);
+ } else {
+ *ctxp = ctx;
}
-
- *ctxp = ctx;
-
- return 0;
+ return ret;
}
int load_config(struct gp_config *cfg)
diff --git a/proxy/src/mechglue/gpp_import_and_canon_name.c b/proxy/src/mechglue/gpp_import_and_canon_name.c
index 0529623..727823c 100644
--- a/proxy/src/mechglue/gpp_import_and_canon_name.c
+++ b/proxy/src/mechglue/gpp_import_and_canon_name.c
@@ -266,7 +266,7 @@ OM_uint32 gssi_release_name(OM_uint32 *minor_status,
{
struct gpp_name_handle *name;
uint32_t rmaj, rmin = 0;
- OM_uint32 maj, min = 0;
+ OM_uint32 maj = 0, min = 0;
GSSI_TRACE();