]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
json: Print to stderr and abort() instead of returning NULL and faulting.
authorScott Bauer <scott.bauer@intel.com>
Mon, 19 Sep 2016 15:47:15 +0000 (09:47 -0600)
committerScott Bauer <scott.bauer@intel.com>
Mon, 19 Sep 2016 15:47:15 +0000 (09:47 -0600)
commit8e7e12a42c075f7dc2511fe56cce1f3ba548a5bb
tree1373855775c204d9303f8bf483cdc02307861c14
parente5b3c2f74640046744bcd0831d164649da188eba
json: Print to stderr and abort() instead of returning NULL and faulting.

No one who uses the JSON API is checking for return values.
Instead of littering the json code with if-else chains,
we will error on any memory allocation failure. Even though
incredibly unlikely malloc will return NULL it's easier to
check for it and print an error instead of faulting.

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
json.c