home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / ultrix / 6396 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.3 KB

  1. Path: sparky!uunet!dove!dove.nist.gov!przemek
  2. From: przemek@rrdstrad.nist.gov (Przemek Klosowski)
  3. Newsgroups: comp.unix.ultrix
  4. Subject: Re: malloc
  5. Message-ID: <PRZEMEK.92Aug21131005@rrdstrad.nist.gov>
  6. Date: 21 Aug 92 17:10:05 GMT
  7. References: <1992Aug20.153542.1417@bmw.mayo.edu> <1992Aug21.021610.11129@decuac.dec.com>
  8. Sender: news@dove.nist.gov
  9. Organization: U. of Maryland/NIST
  10. Lines: 27
  11. In-reply-to: mjr@hussar.dco.dec.com's message of 21 Aug 92 02:16:10 GMT
  12.  
  13. In article <1992Aug21.021610.11129@decuac.dec.com> mjr@hussar.dco.dec.com (Marcus J. Ranum) writes:
  14.    staniszewski@mayo.edu writes:
  15.  
  16.    >I am having trouble finding a problem with dynamicly allocated memory.
  17.  
  18.        You could try using the mprof code from (as usual) decuac.dec.com,
  19.    in /pub/sources/mprof-3.0.tar.Z
  20.  
  21. Alternative malloc debugging library can be had from comp.sources.reviewed
  22. (malloclib). Its claim to fame is that it containts private versions of 
  23. string and block move routines, so it will complain when you do
  24.  
  25.     strcpy(malloc(strlen(string1)),string1)
  26. instead of 
  27.     strcpy(malloc(strlen(string1)+1),string1)
  28. (incidentally, it will handle the malloc failure as well)
  29.  
  30. I found it useful.
  31.  
  32.  
  33. --
  34.             przemek klosowski (przemek@rrdstrad.nist.gov)
  35.             Reactor Division (bldg. 235), E111
  36.             National Institute of Standards and Technology
  37.             Gaithersburg, MD 20899,      USA
  38.  
  39.             (301) 975 6249
  40.