]> git.notmuchmail.org Git - notmuch/commitdiff
lib/message.cc: fix Coverity finding (use after free)
authorTomi Ollila <tomi.ollila@iki.fi>
Fri, 17 Mar 2017 22:28:48 +0000 (00:28 +0200)
committerDavid Bremner <david@tethera.net>
Sat, 18 Mar 2017 23:59:46 +0000 (20:59 -0300)
The object where pointer to `data` was received was deleted before
it was used in _notmuch_string_list_append().

Relevant Coverity messages follow:

3: extract
Assigning: data = std::__cxx11::string(message->doc.()).c_str(),
which extracts wrapped state from temporary of type std::__cxx11::string.

4: dtor_free
The internal representation of temporary of type std::__cxx11::string
is freed by its destructor.

5: use after free:
Wrapper object use after free (WRAPPER_ESCAPE)
Using internal representation of destroyed object local data.


No differences found