BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
bmem = BIO_new(BIO_s_mem());
+ if (bmem == NULL) {
+ _ERR("BIO_new with BIO_s_mem failed ");
+ BIO_free(b64);
+ return -1;
+ }
b64 = BIO_push(b64, bmem);
BIO_write(b64, input, inlen);
BIO_flush(b64);
_ERR("BIO_new_mem_buf failed");
SAFE_DELETE(base64);
+ BIO_free(b64);
return -1;
}
_ERR("BIO_read failed");
SAFE_DELETE(base64);
+ BIO_free_all(b64);
return -1;
}
BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
bmem = BIO_new(BIO_s_mem());
+ if (bmem == NULL) {
+ _ERR("BIO_new failed \n");
+ free(output);
+ BIO_free(b64);
+ return NULL;
+ }
b64 = BIO_push(b64, bmem);
BIO_write(b64, input, ip_len);
BIO_flush(b64);
memcpy(output, bptr->data, bptr->length);
output[bptr->length] = 0;
- if (b64)
- BIO_free_all(b64);
+ BIO_free_all(b64);
return (char*)output;
}
(*decoded_data) = (unsigned char *) calloc((*decoded_size) * 1.5, sizeof(char));
BIO *bmem = BIO_new_mem_buf((void *) encoded_data, (*decoded_size));
+ if (bmem == NULL) {
+ _ERR("BIO_new failed \n");
+ return -1;
+ }
BIO *bioCmd = BIO_new(BIO_f_base64());
+ if (bioCmd == NULL) {
+ _ERR("BIO_new failed \n");
+ BIO_free(bmem);
+ return -1;
+ }
BIO_set_flags(bioCmd, BIO_FLAGS_BASE64_NO_NL);
if (ret != 1) {
_ERR("EVP_Digest failed");
OPENSSL_free(der_pubkey);
+ free(cert_raw);
return NULL;
}
char *pub_key = __b64_encode(pubkey_der_digest, (int)hashed_len);
OPENSSL_free(der_pubkey);
+ free(cert_raw);
if (pub_key != NULL)
_INFO("%s", pub_key);
*/
cb_data->caller_app_id = __get_tz_facet_id_of_caller(app_id, invocation);
if (cb_data->caller_app_id == NULL) {
+ SAFE_DELETE(app_id);
SAFE_DELETE(cb_data);
return FIDO_ERROR_PERMISSION_DENIED;
}
_DBG("UAF msg does not have appID");
cb_data->real_app_id = __get_tz_facet_id_of_caller(app_id, invocation);
g_timeout_add(2, __timer_expired, cb_data);
+ SAFE_DELETE(app_id);
return FIDO_ERROR_NONE;
}
cb_data->real_app_id = strdup(uaf_app_id);
g_timeout_add(2, __timer_expired, cb_data);
-
+ SAFE_DELETE(app_id);
return FIDO_ERROR_NONE;
}
_INFO("soup_uri_new failed");
_free_app_id_cb_data(cb_data);
+ SAFE_DELETE(app_id);
return FIDO_ERROR_PERMISSION_DENIED;
}
const char *scheme = soup_uri_get_scheme(parsed_uri);
if (scheme == NULL) {
_free_app_id_cb_data(cb_data);
+ SAFE_DELETE(app_id);
return FIDO_ERROR_INVALID_PARAMETER;
}
if (strcmp(SOUP_URI_SCHEME_HTTPS, scheme) != 0) {
_free_app_id_cb_data(cb_data);
+ SAFE_DELETE(app_id);
return FIDO_ERROR_INVALID_PARAMETER;
}
_INFO("Added in soup_session_queue_message");
+ SAFE_DELETE(app_id);
return FIDO_ERROR_NONE;
}