diff --git a/jtag/src/part/parse.c b/jtag/src/part/parse.c index 09cbed08..64658a81 100644 --- a/jtag/src/part/parse.c +++ b/jtag/src/part/parse.c @@ -41,8 +41,12 @@ part * read_part( FILE *f ) { int line = 0; + part *part; - part *part = part_alloc(); + if (!f) + return NULL; + + part = part_alloc(); if (!part) { printf( "out of memory\n" ); return NULL;