]> git.cworth.org Git - notmuch/commit
json_quote_chararray: Always return a newly talloced array
authorAnthony <aj@erisian.com.au>
Tue, 20 Apr 2010 15:55:31 +0000 (08:55 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 20 Apr 2010 15:55:31 +0000 (08:55 -0700)
commit55d06f3e0bc12c27879bba98153d70ea399ec737
tree9b28725700216320add062607f3fafe80f255803
parentcacefbf3d6dd5bce0b60b3cdfce29bfa371dfaea
json_quote_chararray: Always return a newly talloced array

The special case for len==0 was wrong---the normal code path is to
talloc to get a newly allocated, editable string, that might be
talloc_free'd later. It makes more sense just to let the len==0
behaviour fall through into the normal case code.

Reviewed-by: Carl Worth <cworth@cworth.org>
This results in the same value being returned, but with the proper
memory handling.
json.c