diff options
author | David Robillard <d@drobilla.net> | 2016-09-18 12:58:47 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-09-18 13:00:45 -0400 |
commit | b5d531a26d2b56108e1228e908c54620fbbc736b (patch) | |
tree | abced43e90386cefd6f332ef686bb4489ae62bf3 /src | |
parent | 584305d0be82b8a135d77af3c058bcd6bb216d28 (diff) | |
download | serd-b5d531a26d2b56108e1228e908c54620fbbc736b.tar.gz serd-b5d531a26d2b56108e1228e908c54620fbbc736b.tar.bz2 serd-b5d531a26d2b56108e1228e908c54620fbbc736b.zip |
Fix memory error
Introduced in 443f470383dc3acba0fde7b705e8ff81a7c49595
Diffstat (limited to 'src')
-rw-r--r-- | src/env.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -245,8 +245,9 @@ serd_env_expand_node(const SerdEnv* env, } const size_t len = prefix.len + suffix.len; uint8_t* buf = (uint8_t*)malloc(len + 1); - SerdNode ret = { buf, len, serd_strlen(buf, NULL, NULL), 0, SERD_URI }; - snprintf((char*)buf, ret.n_bytes + 1, "%s%s", prefix.buf, suffix.buf); + SerdNode ret = { buf, len, 0, 0, SERD_URI }; + snprintf((char*)buf, len + 1, "%s%s", prefix.buf, suffix.buf); + ret.n_chars = serd_strlen(buf, NULL, NULL); return ret; } case SERD_URI: { |