From 8f17be689aec490a2d396b1279e4e6ceecd540ab Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 21 Apr 2016 14:52:18 -0400 Subject: Fix use after free bug Signed-off-by: Simo Sorce Reviewed-by: Robbie Harwood --- proxy/src/gp_creds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'proxy') diff --git a/proxy/src/gp_creds.c b/proxy/src/gp_creds.c index e7f2676..255200c 100644 --- a/proxy/src/gp_creds.c +++ b/proxy/src/gp_creds.c @@ -316,11 +316,12 @@ static int gp_get_cred_environment(struct gp_call_ctx *gpcall, namebuf.length = strlen(str); ret_maj = gss_import_name(&ret_min, &namebuf, GSS_C_NT_USER_NAME, requested_name); - safefree(str); if (ret_maj) { GPERROR("Failed to import username %s\n", str); + safefree(str); return ENOMEM; } + safefree(str); } } -- cgit