From 27d503a51162ff8c453ecd21dbb026264ac5425d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 8 May 2006 09:55:37 +0000 Subject: [PATCH] (mic_des3): make sure message_buffer doesn't point to free()ed memory on failure. Pointed out by IBM checker. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17507 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/gssapi/get_mic.c | 2 ++ lib/gssapi/krb5/get_mic.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/gssapi/get_mic.c b/lib/gssapi/get_mic.c index 6526ebecb..d0f82c5dd 100644 --- a/lib/gssapi/get_mic.c +++ b/lib/gssapi/get_mic.c @@ -172,6 +172,8 @@ mic_des3 tmp = malloc (message_buffer->length + 8); if (tmp == NULL) { free (message_token->value); + message_token->value = NULL; + message_token->length = 0; *minor_status = ENOMEM; return GSS_S_FAILURE; } diff --git a/lib/gssapi/krb5/get_mic.c b/lib/gssapi/krb5/get_mic.c index 6526ebecb..d0f82c5dd 100644 --- a/lib/gssapi/krb5/get_mic.c +++ b/lib/gssapi/krb5/get_mic.c @@ -172,6 +172,8 @@ mic_des3 tmp = malloc (message_buffer->length + 8); if (tmp == NULL) { free (message_token->value); + message_token->value = NULL; + message_token->length = 0; *minor_status = ENOMEM; return GSS_S_FAILURE; }