diff options
Diffstat (limited to 'trust')
-rw-r--r-- | trust/module.c | 5 | ||||
-rw-r--r-- | trust/parser.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/trust/module.c b/trust/module.c index 5759e91..ed93479 100644 --- a/trust/module.c +++ b/trust/module.c @@ -537,7 +537,7 @@ sys_C_GetTokenInfo (CK_SLOT_ID id, { CK_RV rv = CKR_OK; p11_token *token; - const char *path; + char *path; size_t length; return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); @@ -569,12 +569,13 @@ sys_C_GetTokenInfo (CK_SLOT_ID id, info->ulFreePrivateMemory = CK_UNAVAILABLE_INFORMATION; /* If too long, copy the last 32 characters into buffer */ - path = basename (p11_token_get_path (token)); + path = p11_basename (p11_token_get_path (token)); length = strlen (path); if (length > sizeof (info->label)) length = sizeof (info->label); memset (info->label, ' ', sizeof (info->label)); memcpy (info->label, path, length); + free (path); } p11_unlock (); diff --git a/trust/parser.c b/trust/parser.c index 8f37637..42d74fc 100644 --- a/trust/parser.c +++ b/trust/parser.c @@ -649,7 +649,7 @@ p11_parse_memory (p11_parser *parser, return_val_if_fail (parser != NULL, P11_PARSE_FAILURE); - base = basename (filename); + base = p11_basename (filename); parser->basename = base; parser->flags = flags; @@ -663,6 +663,8 @@ p11_parse_memory (p11_parser *parser, } p11_asn1_cache_flush (parser->asn1_cache); + + free (base); parser->basename = NULL; parser->flags = 0; |