]> git.cworth.org Git - obsolete/notmuch-old/commit
lib: Don't delete uninitialized pointers
authorAustin Clements <amdragon@MIT.EDU>
Sun, 29 Jan 2012 05:50:08 +0000 (00:50 -0500)
committerDavid Bremner <bremner@debian.org>
Sat, 4 Feb 2012 01:14:59 +0000 (21:14 -0400)
commita8ee1c75c348f41d88398fc394812e66e8e8b72e
tree55d1792cbd649358286d12c3a6172932f1405bd2
parent6dec2af55bb393e338586a2a399a659e54240a1f
lib: Don't delete uninitialized pointers

In the error-handling paths of notmuch_database_open, we call
notmuch_database_close, which "delete"s several objects referenced by
the notmuch_database_t object.  However, some of these pointers may be
uninitialized, resulting in undefined behavior.  Hence, allocate the
notmuch_database_t with talloc_zero to make sure these pointers are
NULL so that "delete"ing them is harmless.
lib/database.cc