From 785fb8e44914777d26dfadaea857770e3c9fe599 Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 24 May 2008 13:29:31 +0000 Subject: fix crash of librfid-tool in scan function (Mate Soos) git-svn-id: https://svn.gnumonks.org/trunk/librfid@2105 e0336214-984f-0b4b-a45f-81c69e1f0ede --- utils/librfid-tool.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'utils') diff --git a/utils/librfid-tool.c b/utils/librfid-tool.c index 5f8698c..c8b59ea 100644 --- a/utils/librfid-tool.c +++ b/utils/librfid-tool.c @@ -456,6 +456,11 @@ static void do_enum(int layer2) if (rh->reader->l2_supported & (1 << layer2)) { l2h = rfid_layer2_init(rh, layer2); + if (!l2h) { + printf("error during layer2(%s)_init\n", + l2_names[layer2]); + return; + } printf("Layer2 init ok\n"); rc = rfid_layer2_open(l2h); } else { -- cgit v1.2.3