From ffae879f55dbcb851045f3aba8987fe3a325d12b Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Thu, 1 Aug 2002 08:01:40 +0000 Subject: [PATCH] Added parameter checking for read_part(). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@87 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/part/parse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;