diff options
author | David Robillard <d@drobilla.net> | 2022-11-24 17:34:21 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-11-25 07:05:57 -0500 |
commit | 292d101ed3b8a0b3d79d45af48feccba827c0942 (patch) | |
tree | f266360c7eaa329e3277008f68fa127b6c75d85a /src/env.c | |
parent | d40a7fe79847ab46e544d9fbb845affbe876c0db (diff) | |
download | serd-292d101ed3b8a0b3d79d45af48feccba827c0942.tar.gz serd-292d101ed3b8a0b3d79d45af48feccba827c0942.tar.bz2 serd-292d101ed3b8a0b3d79d45af48feccba827c0942.zip |
Always handle the return value of serd_env_set_base_uri()
Diffstat (limited to 'src/env.c')
-rw-r--r-- | src/env.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |