>From 959be0db177feb4522f8710fff9ffcde0dec994e Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 28 Mar 2015 16:49:17 +0100 Subject: [PATCH 4/5] 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". --- 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 14c65e405e87213ed3906c308e0a1c42af977f68..e5a58bb2431c80deb89496034cb6fc51ac8e52cb 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); -- 2.3.4