From 00c6b95f7f10bd0b1897f8384d7ff985a9633c81 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 28 Mar 2015 16:49:17 +0100 Subject: 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 Reviewed-by: Simo Sorce --- proxy/src/client/gpm_init_sec_context.c | 1 + 1 file changed, 1 insertion(+) 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); -- cgit