- fix a resource leak in SignatureHelper.cpp
Change-Id: I8749fcf045feebf79ff05481eeb15859077912a1
/* export C API */
using namespace smartcard_service_api;
/* export C API */
using namespace smartcard_service_api;
-certiHash* __signature_helper_vector_to_linked_list(vector<ByteArray> &certHashes)
+certiHash *__signature_helper_vector_to_linked_list(vector<ByteArray> &certHashes)
{
vector<ByteArray>::iterator item;
certiHash *head, *tail, *tmp;
{
vector<ByteArray>::iterator item;
certiHash *head, *tail, *tmp;
for (item = certHashes.begin(); item != certHashes.end(); item++)
{
for (item = certHashes.begin(); item != certHashes.end(); item++)
{
- if((tmp = (certiHash*)calloc(1, sizeof(certiHash)))== NULL)
+ if ((tmp = (certiHash *)calloc(1, sizeof(certiHash))) == NULL)
goto ERROR;
tmp->length = (*item).getLength();
goto ERROR;
tmp->length = (*item).getLength();
- if((tmp->value = (uint8_t*)calloc(tmp->length, sizeof(uint8_t))) == NULL)
+ if ((tmp->value = (uint8_t *)calloc(tmp->length, sizeof(uint8_t))) == NULL)
+ {
+ free(tmp);
memcpy(tmp->value, (*item).getBuffer(), tmp->length);
tmp->next = NULL;
memcpy(tmp->value, (*item).getBuffer(), tmp->length);
tmp->next = NULL;
- SCARD_DEBUG_ERR("mem alloc fail");
+ SCARD_DEBUG_ERR("mem alloc fail");
- while(head)
- {
- tmp = head;
- head = head->next;
- if(tmp->value != NULL)
- free(tmp->value);
- free(tmp);
- }
-
- return NULL;
+ while (head)
+ {
+ tmp = head;
+ head = head->next;
+ if (tmp->value != NULL)
+ free(tmp->value);
+ free(tmp);
+ }
}
EXTERN_API int signature_helper_get_process_name(int pid, char *processName, uint32_t length)
}
EXTERN_API int signature_helper_get_process_name(int pid, char *processName, uint32_t length)
Name: smartcard-service
Summary: Smartcard Service FW
Name: smartcard-service
Summary: Smartcard Service FW
-Version: 0.1.4
-Release: 2
+Version: 0.1.7
+Release: 1
Group: libs
License: Samsung Proprietary License
Source0: %{name}-%{version}.tar.gz
Group: libs
License: Samsung Proprietary License
Source0: %{name}-%{version}.tar.gz