Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!chinacat!sequoia!unisql!pckim From: pckim@unisql.UUCP (Pyung-Chul Kim) Newsgroups: comp.lang.c Subject: Re: Failure INSIDE malloc() ?? Message-ID: <1383@unisql.UUCP> Date: 21 Jun 91 14:20:12 GMT References: <1991Jun19.131709.13260@risky.ecs.umass.edu> <677448705@macbeth.cs.duke.edu> Reply-To: pckim@unisql.UUCP (Pyung-Chul Kim) Organization: UniSQL, Inc., Austin, Texas Lines: 30 In article <677448705@macbeth.cs.duke.edu> lsn@duke.cs.duke.edu (Lars S. Nyland) writes: > some stuffs deleted > >I would bet that you still use a pointer after you have freed >the memory it points to. You might amend your free statements >to be more like: > free(p); p = NULL; >just to make sure that you don't use the pointers after you have >freed them. Or, make sure the following should not happen: char str[n]; strcpy(str,another1); /* strlen(another1) >= n */ char *p; p = malloc(m); strcpy(p,another2); /* strlen(another2) >= m */ Hope this helps -- Pyung-Chul Kim UniSQL, Inc. 9390 Research Blvd., Kaleido II, Suite 220, Austin, TX 78759 Internet: execu!sequoia!unisql!pckim@cs.utexas.edu UUCP: {uunet, cs.utexas.edu!execu}!sequoia!unisql!pckim TEL: (512)343-7297 Ext. 332 FAX: (512)343-7383