summaryrefslogtreecommitdiff
path: root/src/eap_peer/tncc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eap_peer/tncc.c')
-rw-r--r--src/eap_peer/tncc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/eap_peer/tncc.c b/src/eap_peer/tncc.c
index 0c5caa7dd522e..a9bafe2886c09 100644
--- a/src/eap_peer/tncc.c
+++ b/src/eap_peer/tncc.c
@@ -126,12 +126,10 @@ static TNC_Result TNC_TNCC_ReportMessageTypes(
imc = tnc_imc[imcID];
os_free(imc->supported_types);
- imc->supported_types =
- os_malloc(typeCount * sizeof(TNC_MessageType));
+ imc->supported_types = os_memdup(supportedTypes,
+ typeCount * sizeof(TNC_MessageType));
if (imc->supported_types == NULL)
return TNC_RESULT_FATAL;
- os_memcpy(imc->supported_types, supportedTypes,
- typeCount * sizeof(TNC_MessageType));
imc->num_supported_types = typeCount;
return TNC_RESULT_SUCCESS;