title: What if malloc fails?
body: <p>If a <code>malloc</code> allocation fails, should we try it again?</p>
  
  <p>In something like this:</p>
  
  <pre><code>char* mystrdup(const char *s)  
  {
      char *ab = NULL;
  
      while(ab == NULL) {
          ab=(char*)malloc(strlen(s)+1);  
      }
  
      strcpy(ab, s);
      return ab;
  }
  </code></pre>
  
  <p>Is the while loop valid for checking the memory allocation?</p>