From: Narasimha S. <nsh...@us...> - 2011-09-23 20:19:33
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv7365 Modified Files: support.c Log Message: [3413031] fixes to perform check before calling free Index: support.c =================================================================== RCS file: /cvsroot/sblim/sfcb/support.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- support.c 21 Jun 2011 22:50:59 -0000 1.37 +++ support.c 23 Sep 2011 20:19:31 -0000 1.38 @@ -410,9 +410,11 @@ mt->cleanupDone = 1; __flush_mt(mt); - if (mt->hc.memObjs) free(mt->hc.memObjs); - if (mt->hc.memEncObjs) free(mt->hc.memEncObjs); - free(mt); + if (mt->hc.memObjs) + { free(mt->hc.memObjs); mt->hc.memObjs = NULL; } + if (mt->hc.memEncObjs) + { free(mt->hc.memEncObjs); mt->hc.memEncObjs = NULL; } + if (mt) { free(mt); mt = NULL; } } _SFCB_EXIT(); } @@ -684,12 +686,15 @@ __flush_mt(mt); - if (mt->hc.memObjs) free(mt->hc.memObjs); - if (mt->hc.memEncObjs) free(mt->hc.memEncObjs); + if (mt->hc.memObjs) { free(mt->hc.memObjs); mt->hc.memObjs = NULL; } + if (mt->hc.memEncObjs) { free(mt->hc.memEncObjs); mt->hc.memEncObjs = NULL; } + if (hc) { memcpy(&mt->hc,hc,sizeof(HeapControl)); free(hc); + hc = NULL; + } _SFCB_EXIT(); } |