From faceac530f415c96d8698c1321711aa30fc5b3c1 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Tue, 27 Sep 2016 21:21:25 +0000 Subject: Fix leak of localname in gp_export_creds_linux() Signed-off-by: Robbie Harwood Reviewed-by: Simo Sorce Merges #33 --- proxy/src/gp_export.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'proxy/src') diff --git a/proxy/src/gp_export.c b/proxy/src/gp_export.c index 256e84a..41af67b 100644 --- a/proxy/src/gp_export.c +++ b/proxy/src/gp_export.c @@ -700,7 +700,7 @@ static uint32_t gp_export_creds_enoent(uint32_t *min, gss_buffer_t buf) static uint32_t gp_export_creds_linux(uint32_t *min, gss_name_t name, gss_const_OID mech, gss_buffer_t buf) { - gss_buffer_desc localname; + gss_buffer_desc localname = {}; uint32_t ret_maj; uint32_t ret_min; struct passwd pwd, *res; @@ -767,6 +767,7 @@ static uint32_t gp_export_creds_linux(uint32_t *min, gss_name_t name, case ENOENT: case ESRCH: free(pwbuf); + gss_release_buffer(&ret_min, &localname); return gp_export_creds_enoent(min, buf); default: ret_min = ret; @@ -817,6 +818,7 @@ done: } free(pwbuf); *min = ret_min; + gss_release_buffer(&ret_min, &localname); return ret_maj; } -- cgit