diff options
Diffstat (limited to 'source4/heimdal/lib/ntlm/ntlm.c')
-rw-r--r-- | source4/heimdal/lib/ntlm/ntlm.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/source4/heimdal/lib/ntlm/ntlm.c b/source4/heimdal/lib/ntlm/ntlm.c index 430e80505e..af950cc3b5 100644 --- a/source4/heimdal/lib/ntlm/ntlm.c +++ b/source4/heimdal/lib/ntlm/ntlm.c @@ -33,7 +33,7 @@ #include <config.h> -RCSID("$Id: ntlm.c,v 1.8 2006/12/26 00:25:17 lha Exp $"); +RCSID("$Id: ntlm.c 20816 2007-06-03 04:36:31Z lha $"); #include <stdio.h> #include <stdlib.h> @@ -308,8 +308,10 @@ heim_ntlm_decode_targetinfo(struct ntlm_buf *data, int ucs2, void heim_ntlm_free_type1(struct ntlm_type1 *data) { - free(data->domain); - free(data->hostname); + if (data->domain) + free(data->domain); + if (data->hostname) + free(data->hostname); memset(data, 0, sizeof(*data)); } @@ -432,9 +434,12 @@ out: */ void -heim_ntlm_free_type2(struct ntlm_type2 *type2) +heim_ntlm_free_type2(struct ntlm_type2 *data) { - memset(type2, 0, sizeof(*type2)); + if (data->targetname) + free(data->targetname); + _ntlm_free_buf(&data->targetinfo); + memset(data, 0, sizeof(*data)); } int @@ -558,10 +563,18 @@ out: void heim_ntlm_free_type3(struct ntlm_type3 *data) { + _ntlm_free_buf(&data->lm); + _ntlm_free_buf(&data->ntlm); + if (data->targetname) + free(data->targetname); + if (data->username) + free(data->username); + if (data->ws) + free(data->ws); + _ntlm_free_buf(&data->sessionkey); memset(data, 0, sizeof(*data)); } - /* * */ |