From fcd3dbd6a10ec71f24cf3084a0a335e56886f3e9 Mon Sep 17 00:00:00 2001 From: Dave Beckett Date: Sun, 17 Jun 2012 22:29:24 -0700 Subject: (rdfa_create_new_element_context): Return NULL on OOM [clang] --- librdfa/context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'librdfa') diff --git a/librdfa/context.c b/librdfa/context.c index d42eef91..bdb80380 100644 --- a/librdfa/context.c +++ b/librdfa/context.c @@ -41,7 +41,7 @@ rdfacontext* rdfa_create_context(const char* base) /* malloc and init whole context to NULL */ rval = (rdfacontext*)malloc(sizeof(rdfacontext)); if(!rval) - return NULL; + return NULL; memset(rval, 0, sizeof(rdfacontext)); @@ -363,6 +363,9 @@ rdfacontext* rdfa_create_new_element_context(rdfalist* context_stack) context_stack->items[context_stack->num_items - 1]->data; rdfacontext* rval = rdfa_create_context(parent_context->base); + if(!rval) + return NULL; + /* * Otherwise, the values are: */ /* * the [ base ] is set to the [ base ] value of the current -- cgit v1.2.1