Subj : Re: malloc() To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Wed Jun 23 2004 12:34 pm If malloc returns NULL then it could not allocate the memory you need. That means it either has run out of memory or that the program has corrupted the allocation list. In either case the program should be ended. new and delete do not change the story. If malloc fails then new will fail. .. Ed > Jan Vernimmen wrote in message > news:40d99cda$1@newsgroups.borland.com... > > Thanks for your comment. > As a matter of fact I do not test every malloc (I feel sorry to > tell) but what do I do if it returns NULL? > Thust repeat the malloc() in a loop until it returns a non-zero > value? > > I was at the point to take a deep breath and rewrite everything > using new() and delete() where I'm using malloc() and free() now. .