Linux: Fix Static Analysis Reported Issues in IPC
[ipc/ipcdev.git] / linux / src / api / MessageQ.c
index db96b241156963cc831833d95edd0de733991b04..945712ea3c8d090570e22f47d3db8657ba414a75 100644 (file)
@@ -1157,10 +1157,9 @@ Int MessageQ_free(MessageQ_Msg msg)
     }
     else {
         heap = (IHeap_Handle)MessageQ_module->heaps[msg->heapId];
+        IHeap_free(heap, (void *)msg);
     }
 
-    IHeap_free(heap, (void *)msg);
-
     return (status);
 }