]> www.infradead.org Git - users/sagi/libnvme.git/commit
libnvme: fix a memory leak when calling read_ssns()
authorMaurizio Lombardi <mlombard@redhat.com>
Tue, 7 Nov 2023 14:51:55 +0000 (15:51 +0100)
committerDaniel Wagner <wagi@monom.org>
Wed, 8 Nov 2023 13:00:46 +0000 (14:00 +0100)
commiteb857fbf9baaa01d552a7ceeb363183dba3101b7
treefd62a9a022e4e5edea4b29e6838b246386e5d741
parent723ab40c64a91d3b3075ca213312129407bf2347
libnvme: fix a memory leak when calling read_ssns()

If the check fails, the verify() macro executes "return -EINVAL"
without freeing the allocated memory.

Fix the bug by moving verify() before the point where we call calloc().

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
src/nvme/nbft.c