https://github.com/libming/libming/commit/6eca133ee9985c298186cbe05f888082c30bf2d9

--- a/util/read.c
+++ b/util/read.c
@@ -247,6 +247,11 @@ char *readString(FILE *f)
     if(len >= buflen-2)
     {
       buf = (char *)realloc(buf, sizeof(char)*(buflen+256));
+      if ( ! buf )
+      {
+        fprintf(stderr, "failed reallocating %d bytes\n", buflen+256);
+        exit(-1);
+      }
       buflen += 256;
       p = buf+len;
     }
@@ -350,6 +355,11 @@ char *readSizedString(FILE *f,int size)
     if(len >= buflen-2)
     {
       buf = (char *)realloc(buf, sizeof(char)*(buflen+256));
+      if ( ! buf )
+      {
+        fprintf(stderr, "failed reallocating %d bytes\n", buflen+256);
+        exit(-1);
+      }
       buflen += 256;
       p = buf+len;
     }
