Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!uxh.cso.uiuc.edu!kingson From: kingson@uxh.cso.uiuc.edu (Kingson Gunawan) Newsgroups: comp.sys.mac.programmer Subject: malloc/calloc problem in Think C Summary: malloc problem Keywords: malloc Message-ID: <1991Jan29.213357.11222@ux1.cso.uiuc.edu> Date: 29 Jan 91 21:33:57 GMT Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 11 I have a problem with Think C malloc and calloc functions. I am writing a progra m that iteratively call several functions. In each of these functions, I alloca te memory space using either malloc or calloc ( I tried both ) and release the s pace using free() function just before I return to the main program from the fun ction. The problem is that after several iteration the program just quit ( the system says " application quit unexpectedly"). When I ran the same program in T hink C debugger I traced the problem coming from the malloc or calloc function. The debugger gave "odd address" error. I know I allocated much more than enoug h memory for this particular program (about 2meg for a program that take only ab out 450k memory including the space for the variables, etc.). Any idea of what type of problem this might be?