fixed potential memory issue
fixed potential memory issue

closes https://github.com/OpenSC/OpenSC/pull/2230

fabled/OpenSC,mouse07410/OpenSC,mouse07410/OpenSC,philipWendland/OpenSC,fabled/OpenSC,philipWendland/OpenSC,Jakuje/OpenSC,OpenSC/OpenSC,metsma/OpenSC,metsma/OpenSC,Jakuje/OpenSC,frankmorgner/OpenSC,fabled/OpenSC,frankmorgner/OpenSC,dengert/OpenSC,frankmorgner/OpenSC,LudovicRousseau/OpenSC,mouse07410/OpenSC,LudovicRousseau/OpenSC,Jakuje/OpenSC,metsma/OpenSC,fabled/OpenSC,LudovicRousseau/OpenSC,dengert/OpenSC,Jakuje/OpenSC,dengert/OpenSC,OpenSC/OpenSC,philipWendland/OpenSC,OpenSC/OpenSC,frankmorgner/OpenSC