[Pcsclite-git-commit] [PCSC] 02/03: hotplug_libudev.c: handle reader addition failure

Ludovic Rousseau rousseau at moszumanska.debian.org
Wed Nov 18 16:06:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository PCSC.

commit ed077d6cfa6a27221730e417bb2758bf78e11549
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Wed Nov 18 16:57:44 2015 +0100

    hotplug_libudev.c: handle reader addition failure
    
    If RFAddReader() fails then the readerTracker[] entry must be cleaned.
    On exit pcscd will then not try to remove a non present reader.
---
 src/hotplug_libudev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/hotplug_libudev.c b/src/hotplug_libudev.c
index 8347f08..2ef7b0b 100644
--- a/src/hotplug_libudev.c
+++ b/src/hotplug_libudev.c
@@ -537,6 +537,17 @@ static void HPAddDevice(struct udev_device *dev)
 		}
 	}
 
+	if (SCARD_S_SUCCESS != ret)
+	{
+		/* adding the reader failed */
+		free(readerTracker[i].devpath);
+		readerTracker[i].devpath = NULL;
+		free(readerTracker[i].fullName);
+		readerTracker[i].fullName = NULL;
+		free(readerTracker[i].sysname);
+		readerTracker[i].sysname = NULL;
+	}
+
 exit:
 	free(fullname);
 	free(deviceName);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git



More information about the Pcsclite-cvs-commit mailing list