pkcs15-init: fixed resource leak
This commit is contained in:
parent
a83da8a947
commit
1f16f24052
|
@ -1798,8 +1798,11 @@ get_pin_callback(struct sc_profile *profile,
|
||||||
allocated = 1;
|
allocated = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len > *pinsize)
|
if (len > *pinsize) {
|
||||||
|
if (allocated)
|
||||||
|
free(secret);
|
||||||
return SC_ERROR_BUFFER_TOO_SMALL;
|
return SC_ERROR_BUFFER_TOO_SMALL;
|
||||||
|
}
|
||||||
memcpy(pinbuf, secret, len + 1);
|
memcpy(pinbuf, secret, len + 1);
|
||||||
*pinsize = len;
|
*pinsize = len;
|
||||||
if (allocated)
|
if (allocated)
|
||||||
|
|
Loading…
Reference in New Issue