--- getopt.c.orig	2015-04-10 16:06:03.548095111 -0700
+++ getopt.c	2015-04-10 16:11:04.544350187 -0700
@@ -521,6 +521,10 @@
               {
                 /* Second or later nonexact match found.  */
                 struct option_list *newp = malloc (sizeof (*newp));
+		if (newp == NULL) { /* oops, malloc() failed, now what? */
+		    /* FIXME - what code do we need here? */
+		    fprintf(stderr, "Error: Unable to allocate memory for newp...\n");
+		}
                 newp->p = p;
                 newp->next = ambig_list;
                 ambig_list = newp;
