firmware-utils: fix coverity zytrx.c resource leak
authorKevin Darbyshire-Bryant <[email protected]>
Sun, 16 May 2021 10:46:32 +0000 (11:46 +0100)
committerKevin Darbyshire-Bryant <[email protected]>
Thu, 20 May 2021 10:56:38 +0000 (11:56 +0100)
commit34e1644ce63d37b726653c051d4a20a75cceb642
treed6f93a711fd4d5e31b4a962a6ab8c994e4d06650
parente4c6a4053e86a64be92147bacfbe70882638f268
firmware-utils: fix coverity zytrx.c resource leak

fix coverity resource leak warning:

     *len = stat.st_size;
     mapped = mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
     if (close(fd) < 0)
CID 1484880:  Resource leaks  (RESOURCE_LEAK)
Variable "mapped" going out of scope leaks the storage it points to.
     return NULL;
     return mapped;
    }

Signed-off-by: Kevin Darbyshire-Bryant <[email protected]>
src/zytrx.c