Browse code

bb11390 - add memory allocation check. Patch by Bill Parker.

Steven Morgan authored on 2015/09/24 01:49:53
Showing 1 changed files
... ...
@@ -608,6 +608,10 @@ static int script2cdiff(const char *script, const char *builder, const struct op
608 608
     osize = (unsigned int) sb.st_size;
609 609
 
610 610
     cdiff = strdup(script);
611
+    if (NULL == cdiff) {
612
+       mprintf("!script2cdiff: Unable to allocate memory for file name\n");
613
+       return -1;
614
+    }
611 615
     pt = strstr(cdiff, ".script");
612 616
     if(!pt) {
613 617
 	mprintf("!script2cdiff: Incorrect file name (no .script extension)\n");