summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-03-28 16:49:17 +0100
committerSimo Sorce <simo@redhat.com>2015-03-29 17:34:42 -0400
commit00c6b95f7f10bd0b1897f8384d7ff985a9633c81 (patch)
tree2d408db61cda8a91afd5912df250de1a2f31d4c8
parent7c5d8946ff04588ee25050b61d72d7d33665fac9 (diff)
downloadgss-proxy-00c6b95f7f10bd0b1897f8384d7ff985a9633c81.tar.gz
gss-proxy-00c6b95f7f10bd0b1897f8384d7ff985a9633c81.tar.xz
gss-proxy-00c6b95f7f10bd0b1897f8384d7ff985a9633c81.zip
Suppress warning: use after free
gssx_ctx is released in case of error. After the latest changes, the old ctx is always replaced to new one and output argument is set. Although it would not be used because return code would not be success it's safer to set NULL to the pointer and avoid warnings from static analyzers. src/client/gpm_init_sec_context.c:108: alias: Assigning: "ctx" = "res->context_handle". Now both point to the same storage. src/client/gpm_init_sec_context.c:156: freed_arg: "free" frees "ctx". src/client/gpm_init_sec_context.c:173: use_after_free: Using freed pointer "ctx". Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
-rw-r--r--proxy/src/client/gpm_init_sec_context.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/proxy/src/client/gpm_init_sec_context.c b/proxy/src/client/gpm_init_sec_context.c
index 14c65e4..e5a58bb 100644
--- a/proxy/src/client/gpm_init_sec_context.c
+++ b/proxy/src/client/gpm_init_sec_context.c
@@ -154,6 +154,7 @@ done:
if (ctx) {
xdr_free((xdrproc_t)xdr_gssx_ctx, (char *)ctx);
free(ctx);
+ ctx = NULL;
}
if (mech) {
free(mech->elements);