diff options
author | Robbie Harwood <rharwood@redhat.com> | 2016-09-27 21:21:25 +0000 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2016-09-28 11:21:10 -0400 |
commit | faceac530f415c96d8698c1321711aa30fc5b3c1 (patch) | |
tree | 850936980fb0590bad2d3d26b3a757caa7cba418 | |
parent | 4c2925d2aa0b7256b53eb61ef072c4685f728bd2 (diff) | |
download | gss-proxy-faceac530f415c96d8698c1321711aa30fc5b3c1.tar.gz gss-proxy-faceac530f415c96d8698c1321711aa30fc5b3c1.tar.xz gss-proxy-faceac530f415c96d8698c1321711aa30fc5b3c1.zip |
Fix leak of localname in gp_export_creds_linux()
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Merges #33
-rw-r--r-- | proxy/src/gp_export.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |