aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sim/reader_pcsc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sim/reader_pcsc.c b/src/sim/reader_pcsc.c
index 9e05e3c0..04a86223 100644
--- a/src/sim/reader_pcsc.c
+++ b/src/sim/reader_pcsc.c
@@ -87,11 +87,14 @@ static struct osim_reader_hdl *pcsc_reader_open(int num, const char *id, void *c
num_readers++;
}
- if (num != num_readers)
+ if (num != num_readers) {
+ SCardFreeMemory(st->hContext, mszReaders);
goto end;
+ }
st->name = talloc_strdup(rh, ptr);
st->dwActiveProtocol = -1;
+ SCardFreeMemory(st->hContext, mszReaders);
return rh;
end: