diff --git a/openair-cn/MME_APP/mme_app_main.c b/openair-cn/MME_APP/mme_app_main.c
index 4e42f77c8245eae4538b498150ba00345c918073..390bc0a2ff517817fe548bec0444cb7e82a97fe2 100644
--- a/openair-cn/MME_APP/mme_app_main.c
+++ b/openair-cn/MME_APP/mme_app_main.c
@@ -107,7 +107,7 @@ void *mme_app_thread(void *args)
                               ITTI_MSG_ID(received_message_p), ITTI_MSG_NAME(received_message_p));
             } break;
         }
-        free(received_message_p);
+        itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p);
         received_message_p = NULL;
     }
     return NULL;
diff --git a/openair-cn/NAS/nas_main.c b/openair-cn/NAS/nas_main.c
index fc4c93f970abfe37b899a305611b4f1667d6bda8..84cd68bb323e15110ff8be4a00b487c4cd925134 100644
--- a/openair-cn/NAS/nas_main.c
+++ b/openair-cn/NAS/nas_main.c
@@ -168,7 +168,7 @@ next_message:
                           ITTI_MSG_NAME(received_message_p));
             } break;
         }
-        free(received_message_p);
+        itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p);
         received_message_p = NULL;
     }
     return NULL;