pkcs15: fixed resource leak
This commit is contained in:
parent
c7afbb4ca2
commit
9263da49aa
|
@ -911,14 +911,19 @@ sc_dup_app_info(const struct sc_app_info *info)
|
||||||
|
|
||||||
if (info->label) {
|
if (info->label) {
|
||||||
out->label = strdup(info->label);
|
out->label = strdup(info->label);
|
||||||
if (!out->label)
|
if (!out->label) {
|
||||||
|
free(out);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
out->label = NULL;
|
out->label = NULL;
|
||||||
|
|
||||||
out->ddo.value = malloc(info->ddo.len);
|
out->ddo.value = malloc(info->ddo.len);
|
||||||
if (!out->ddo.value)
|
if (!out->ddo.value) {
|
||||||
|
free(out->label);
|
||||||
|
free(out);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
memcpy(out->ddo.value, info->ddo.value, info->ddo.len);
|
memcpy(out->ddo.value, info->ddo.value, info->ddo.len);
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|
Loading…
Reference in New Issue