strbuffer_value: Return a read-only pointer rather than duplicating the value

This commit is contained in:
Petri Lehtinen
2009-06-13 22:26:45 +03:00
parent 3e0134782b
commit 8c697312e4
3 changed files with 4 additions and 4 deletions

View File

@@ -222,7 +222,7 @@ char *json_dumps(const json_t *json, uint32_t flags)
if(dump_to_strbuffer("\n", 1, (void *)&strbuff))
return NULL;
result = strbuffer_value(&strbuff);
result = strdup(strbuffer_value(&strbuff));
strbuffer_close(&strbuff);
return result;