RET_IF_FAIL(input != NULL, NULL);
RET_IF_FAIL(ip_len > 0, NULL);
- unsigned char *output = calloc(ip_len * 1.5, sizeof(char));
-
+ unsigned char *output = NULL;
BIO *bmem = NULL;
BIO *b64 = NULL;
BUF_MEM *bptr = NULL;
+
+ output = calloc(ip_len * 1.5, sizeof(char));
+ if (output == NULL) {
+ _ERR("memory allocation failed \n");
+ return NULL;
+ }
b64 = BIO_new(BIO_f_base64());
if (b64 == NULL) {
_ERR("BIO_new failed \n");
if (uaf_tr->display_charac != NULL) {
asm_tr->display_charac = calloc(1, sizeof(_fido_asm_display_png_characteristics_descriptor_t));
if (asm_tr->display_charac == NULL) {
+ SAFE_DELETE(asm_tr->content);
+ SAFE_DELETE(asm_tr->content_type);
SAFE_DELETE(asm_tr);
return NULL;
}
fido_rgb_pallette_entry_s *asm_plte_entry = calloc(1, sizeof(fido_rgb_pallette_entry_s));
if (asm_plte_entry == NULL) {
+ SAFE_DELETE(asm_tr->content);
+ SAFE_DELETE(asm_tr->content_type);
SAFE_DELETE(asm_tr->display_charac);
SAFE_DELETE(asm_tr);
return NULL;