aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/env.c b/src/env.c
index 97bccfba..9a3d2ea5 100644
--- a/src/env.c
+++ b/src/env.c
@@ -25,8 +25,11 @@ SerdEnv*
serd_env_new(const SerdNode* const base_uri)
{
SerdEnv* env = (SerdEnv*)calloc(1, sizeof(struct SerdEnvImpl));
- if (env && base_uri) {
- serd_env_set_base_uri(env, base_uri);
+ if (env && base_uri && base_uri->type != SERD_NOTHING) {
+ if (serd_env_set_base_uri(env, base_uri)) {
+ free(env);
+ return NULL;
+ }
}
return env;