diff options
author | David Robillard <d@drobilla.net> | 2011-05-11 23:31:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-11 23:31:59 +0000 |
commit | 126e208fa58bc787aa7e96990e83031dfcd463be (patch) | |
tree | f961dce5fe4e3bd675b29fb561bd1f2b3aa59a72 /src/env.c | |
parent | 926f29ed81a34a50c9221a2d562119db84a136cb (diff) | |
download | serd-126e208fa58bc787aa7e96990e83031dfcd463be.tar.gz serd-126e208fa58bc787aa7e96990e83031dfcd463be.tar.bz2 serd-126e208fa58bc787aa7e96990e83031dfcd463be.zip |
Fix crash when setting an identical namespace prefix.
git-svn-id: http://svn.drobilla.net/serd/trunk@169 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/env.c')
-rw-r--r-- | src/env.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -111,8 +111,9 @@ serd_env_add(SerdEnv* env, assert(name && uri); SerdPrefix* const prefix = serd_env_find(env, name->buf, name->n_chars); if (prefix) { - serd_node_free(&prefix->uri); + SerdNode old_prefix_uri = prefix->uri; prefix->uri = serd_node_copy(uri); + serd_node_free(&old_prefix_uri); } else { env->prefixes = realloc(env->prefixes, (++env->n_prefixes) * sizeof(SerdPrefix)); |