This is the mail archive of the cygwin-developers@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

failed malloc()?


I've started reviewing some of the winsup code and had a question as to
how to most properly correct unchecked pointers. That is, I know to add a
statement to check the freshly created/passed pointer, but not what to do
in the instance that pointer is NULL. 

Some places in the cygwin code do a system_printf() which is what I will
assume is desired, but wanted to check to make sure what the
standard/preferred way of handling such things is (if there is one).

Here one of the sections of code I am looking at (cygcheck.c:91,92):
  paths[num_paths] = (char *) malloc (maxlen + 1);
  memcpy (paths[num_paths], s, maxlen);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]