From ef194bc692d4bb5fddc2c437ce66aa32080ca2dc Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 15 Oct 2009 15:45:20 +0200 Subject: s3-spnego: fix memleak in spnego_parse_auth(). Guenther --- source3/libsmb/clispnego.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c index 1103ef84b6..e20749b3e8 100644 --- a/source3/libsmb/clispnego.c +++ b/source3/libsmb/clispnego.c @@ -507,10 +507,14 @@ bool spnego_parse_auth(DATA_BLOB blob, DATA_BLOB *auth) if (token.type != SPNEGO_NEG_TOKEN_TARG) { DEBUG(3,("spnego_parse_auth: wrong token type: %d\n", token.type)); + spnego_free_data(&token); return false; } - *auth = token.negTokenTarg.responseToken; + *auth = data_blob_talloc(talloc_tos(), + token.negTokenTarg.responseToken.data, + token.negTokenTarg.responseToken.length); + spnego_free_data(&token); return true; } -- cgit