Commits

carl douglas committed 7a936ce

check for null pointer

  • Participants
  • Parent commits 1c7461a

Comments (0)

Files changed (1)

   char **fields;
   row = mysql_fetch_row(result);
   fields = (char **)malloc(sizeof(char *) * (num_fields + 1));
+  if (fields == NULL) {
+    fprintf(stderr, "out of memory\n");
+    return(C_SCHEME_FALSE);
+  }
   bzero(fields, sizeof (char *) * (num_fields + 1));
   for (;row && index--;) {
     if (row[index] == NULL)