diff options
Diffstat (limited to 'tools/zynqmpimage.c')
-rw-r--r-- | tools/zynqmpimage.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/zynqmpimage.c b/tools/zynqmpimage.c index 60d8ed23b4..0c9a3daddd 100644 --- a/tools/zynqmpimage.c +++ b/tools/zynqmpimage.c @@ -251,11 +251,15 @@ static void zynqmpimage_parse_initparams(struct zynqmp_header *zynqhdr, } err = fstat(fileno(fp), &path_stat); - if (err) + if (err) { + fclose(fp); return; + } - if (!S_ISREG(path_stat.st_mode)) + if (!S_ISREG(path_stat.st_mode)) { + fclose(fp); return; + } do { r = fscanf(fp, "%x %x", ®init.address, ®init.data); |