const SecAsn1Template *theTemplate,
void *dest, PRBool new_depth)
{
- sec_asn1d_state *state, *new_state;
+ sec_asn1d_state *state, *new_state = NULL;
state = cx->current;
PORT_ArenaRelease(cx->our_pool, state->our_mark);
state->our_mark = NULL;
}
+ if (new_state != NULL) {
+ PORT_Free(new_state);
+ }
return NULL;
}
alloc_len += subitem->len;
}
- item->Data = (unsigned char*)sec_asn1d_zalloc (poolp, alloc_len);
- if (item->Data == NULL) {
+ if (item) {
+ item->Data = (unsigned char*)sec_asn1d_zalloc (poolp, alloc_len);
+ }
+ if (item == NULL || item->Data == NULL) {
dprintf("decodeError: prepare for contents zalloc\n");
state->top->status = decodeError;
break;