]> www.infradead.org Git - users/hch/nvme-cli.git/commit
nvme-cli: json_add_smart_log(): Fix memory leak for JSON.
authorChaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
Fri, 24 Feb 2017 02:39:37 +0000 (18:39 -0800)
committerKeith Busch <keith.busch@intel.com>
Fri, 24 Feb 2017 15:18:56 +0000 (10:18 -0500)
commitdae6709dc4383f1539e34b05e1c4eb88a051f1a7
tree3654d2902c3809238b953a3951ffb7db1abfca36
parent9d8d7467f2bd44e6b24439697878580f66c83a5d
nvme-cli: json_add_smart_log(): Fix memory leak for JSON.

This patch fixes the following memory leak for json_add_smart_log()
when used by the external function:-
==8637== HEAP SUMMARY:
==8637==     in use at exit: 1,807 bytes in 56 blocks
==8637==   total heap usage: 101 allocs, 45 frees, 6,577 bytes allocated
==8637==
==8637== LEAK SUMMARY:
==8637==    definitely lost: 24 bytes in 1 blocks
==8637==    indirectly lost: 1,783 bytes in 55 blocks
==8637==      possibly lost: 0 bytes in 0 blocks
==8637==    still reachable: 0 bytes in 0 blocks
==8637==         suppressed: 0 bytes in 0 blocks

Fix:-
==8667== HEAP SUMMARY:
==8667==     in use at exit: 0 bytes in 0 blocks
==8667==   total heap usage: 101 allocs, 152 frees, 6,577 bytes allocated
==8667==

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