]> www.infradead.org Git - users/hch/nvme-cli.git/commit
nvme-cli: id-ctrl: Fix memory leak for JSON.
authorChaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
Fri, 24 Feb 2017 02:39:31 +0000 (18:39 -0800)
committerKeith Busch <keith.busch@intel.com>
Fri, 24 Feb 2017 15:18:40 +0000 (10:18 -0500)
commitb6d538023dfddaf60acc10952d7f5ac06431ca17
treed3162de7af85a8708c1a2f7f6468eba5ec2b63f1
parent317f6ee048d32fc0db6b552311505010d802099f
nvme-cli: id-ctrl: Fix memory leak for JSON.

This patch fixes the following memory leak when id-ctrl command
executed with JSON option:-
==7680==
==7680== HEAP SUMMARY:
==7680==     in use at exit: 9,796 bytes in 338 blocks
==7680==   total heap usage: 474 allocs, 136 frees, 24,729 bytes allocated
==7680==
==7680== LEAK SUMMARY:
==7680==    definitely lost: 24 bytes in 1 blocks
==7680==    indirectly lost: 9,772 bytes in 337 blocks
==7680==      possibly lost: 0 bytes in 0 blocks
==7680==    still reachable: 0 bytes in 0 blocks
==7680==         suppressed: 0 bytes in 0 blocks

Fix:-
==7971==
==7971== HEAP SUMMARY:
==7971==     in use at exit: 0 bytes in 0 blocks
==7971==   total heap usage: 474 allocs, 474 frees, 24,729 bytes allocated
==7971==

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
nvme-print.c