rman: getInternalState replace myAlloc with malloc
authorAjay Jayaraj <ajayj@ti.com>
Mon, 20 Jun 2016 22:26:46 +0000 (17:26 -0500)
committerChris Ring <cring@ti.com>
Thu, 23 Jun 2016 17:08:03 +0000 (10:08 -0700)
Patch to fix issue raised in:
https://e2e.ti.com/support/embedded/tirtos/f/355/p/514906/1869922

There is a call to malloc in getInternalState(). Replacing this call to malloc
with the memory allocator function myAlloc. The corresponding free was
replaced with myFree.

packages/ti/sdo/fc/rman/rman.c

index 580b7a1de707e4ac4499178f1937f6379bcb1d2e..42d7b9f6c7ecfabf5b004c6cf9ad424c419375fd 100644 (file)
@@ -1493,8 +1493,8 @@ static void getInternalState()
     static RMAN_InternalState _RMAN_internalState;
     rmanInternalState = (RMAN_InternalState *)
             &_RMAN_internalState;
-    algresVTable = (RMAN_VtableEntry *)(malloc(ti_sdo_fc_rman_RMAN_MAXALGS *
-            sizeof(RMAN_VtableEntry)));
+    algresVTable = (RMAN_VtableEntry *)(myAlloc(ti_sdo_fc_rman_RMAN_MAXALGS *
+            sizeof(RMAN_VtableEntry), 0));
     setInternalState(rmanInternalState);
     sharedMemId = 0;
 #endif
@@ -1513,7 +1513,7 @@ static void freeInternalState()
     SHM_freeObj(rmanInternalState, rmanInternalState->info.sharedMemId);
 #else
     if (algresVTable) {
-        free(algresVTable);
+        myFree(algresVTable, ti_sdo_fc_rman_RMAN_MAXALGS * sizeof(RMAN_VtableEntry));
         algresVTable = NULL;
     }