Resolved memory leak - memory cleaned up. Fixed bug with realloc() - pointer was not initialized properly for int array type. Temporary file name md5 of full path to less file - So no need for cleaning up directory